📜  js 类异步构造函数 - Javascript 代码示例

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

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