js promise中如何取到[[PromiseValue]]

时间:2018-05-18 18:09:46   收藏:0   阅读:7078
返回的值
Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "http://dl.stream.qqmusic.qq.com/M8000046HRBd0FvKLm…C380C8F140044403EDC0124&guid=489780640&fromtag=30" }



取其中的
PromiseValue

var a = Promise.resolve(‘xx‘) // Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "xx"} a.then(function (result) { console.log(result) })
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!