Сообщение от рони
|
почему?
может так для вас проще будет
<script>
"use strict";
(async () => {
let url = '...';
let response = await fetch(url);
let result = await response.json();
for (let item of result) {console.log(item)};
})()
</script>
|
начинает падать ошибка:
Uncaught SyntaxError: await is only valid in async functions and the top level bodies of module
upd: все заработало в итоге.