[英]Is it possible to set the value of `this` inside a promise executor function?
此代碼是否可能:
var this_module = {
foo: 'something'
promise: new Promise (function(resolve, reject) {
resolve (this.foo);
})
}
將this
的值設置為this_module
以便this.foo
將是foo: 'something'
?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.