回答編集履歴
1
修正
answer
CHANGED
@@ -13,14 +13,14 @@
|
|
13
13
|
<script>
|
14
14
|
class C {
|
15
15
|
async init() {
|
16
|
-
|
16
|
+
this.data = await fetch("john.json").then(a => a.json());
|
17
17
|
return this;
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
21
|
(async () => {
|
22
22
|
const c = await new C().init();
|
23
|
-
console.log(c.name);
|
23
|
+
console.log(c.data.name);
|
24
24
|
})();
|
25
25
|
</script>
|
26
26
|
</body>
|