Сообщение от Neznayka
|
function(result) {
for (var i=0; i < result.length; i++) {
console.log(result[i]);
}
}
|
Вот это вот все можно вынести во "внешнюю" функцию...
Тогда будет вообще вот так
fetch(url, options)
.then(response => response.json())
.then(test)
.catch(error => console.log("error", error));
//
function test(result) {
for (var i=0; i < result.length; i++) {
console.log(result[i]);
}
}