Estoy tratando de hacer un bucle de una serie de objetos dentro de una búsqueda. ¿Hay alguna manera de que pueda hacer un bucle dentro de una búsqueda o hacer que la búsqueda devuelva la matriz de alguna manera?
Esto es lo que he intentado:
fetch(url) .then(response => response.json()) .then(data => for (i = 0; i < data.length; i++) { console.log(data[i]) })Debe envolver .then(data) entre llaves
fetch(url) .then(response => response.json()) .then(data => { for (i = 0; i < data.length; i++) { console.log(data[i]) } })