回答編集履歴

1

修正

2020/09/24 13:53

投稿

Zuishin
Zuishin

スコア28662

test CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  async init() {
30
30
 
31
- Object.assign(this, await fetch("john.json").then(a => a.json()));
31
+ this.data = await fetch("john.json").then(a => a.json());
32
32
 
33
33
  return this;
34
34
 
@@ -42,7 +42,7 @@
42
42
 
43
43
  const c = await new C().init();
44
44
 
45
- console.log(c.name);
45
+ console.log(c.data.name);
46
46
 
47
47
  })();
48
48