下面的代码取自https://javascript.info/promise-api的最后一个任务。 当我运行以下命令时,我无法获得与注释指示的警报相匹配的输出。我假设我在catch语句中遗漏了一些东西,但我不知道我错在哪里。感谢大家的帮助! // the whole promise chain fails with an error here// make errors appear as members of the results array
'https://api.github.com/users/iliak
给出一小段如下代码: let p = somePromise function (response) { return theNextPromise; function (error) { return theNextPromise;).then((result) => { ...do more stuff here }
我有一个问题,我不知道如何用更好的方法来解决它。问题是我请求Spotify Web API,在一些方法中,艺术家图像被返回,而在另一些方法中,只获得基本的艺术家信息。 我有两种方法: fun getAlbum(albumId: String): Single<SpotifyAlbumDTO>
fun getArtist(artistId: String): Single<SpotifyArtistDTO> 当我得到一个相册时,艺术家信息不包含艺术家图像url。因此,我需要调用getAlbum()方法并使用结果来获取artistId,然后调用getArtist()方法
我目前正在学习Node.js/JavaScript,以便使用Discordie库编写一个不一致的机器人。e.message.author.openDM().then(dm => dm.sendMessage(`You have been kicked from the **${e.message.guild.name}** server for using a slur. Please consider this a probation. When you feel th