1function asyncRequest(id){
2 return new Paormise(/*.....*/);
3}
4class MyClass {
5 constructor(name, age, cityId) {
6 (async function() {
7 this.name = name;
8 this.age = age;
9 this.city = await asyncRequest(cityId);
10 })();
11 }
12}
1function asyncRequest(id){
2 return new Promise(/*.....*/);
3}
4class MyClass {
5 constructor(async) {
6 (async function() {
7 this.city = await asyncRequest(async);
8 })();
9 }
10}