📜  异步构造函数 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:35.853000             🧑  作者: Mango

代码示例2
function asyncRequest(id){
    return new Promise(/*.....*/);
}
class MyClass {
    constructor(async) {
        (async function() {
          this.city = await asyncRequest(async);
        })();
    }
}