What is the canonical way to create a resolved promise in ES 2015?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The Promise.resolve
class method returns a promise that is instantiated as resolved with a value you can specify:
var promise = Promise.resolve(100);