fix await fetch
This commit is contained in:
parent
558b75b3c6
commit
2145b93704
4
game.js
4
game.js
@ -8,9 +8,9 @@ var nextCpu;
|
|||||||
var score;
|
var score;
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
await fetch('./data.json')
|
await (fetch('./data.json')
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((json) => cpuList = json);
|
.then((json) => cpuList = json));
|
||||||
|
|
||||||
currentCpu = getRandomCpu();
|
currentCpu = getRandomCpu();
|
||||||
nextCpu = getRandomCpu();
|
nextCpu = getRandomCpu();
|
||||||
|
Loading…
Reference in New Issue
Block a user