I built a small pagination project in REPL, and it is works - in REPL. However when I built an actual project using degit, using the same exact code - my iterator in the for loop is coming up with "not defined".
This is an async function that populates an array using data from an api endpoint. The data does populate.
const getData = async () => {
await fetch("https://jsonplaceholder.typicode.com/todos")
.then(response => response.json())
.then(res => console.log(res)) // data populates!
.then(json => {
for(i = 0; i < 200; i++){
value = [...value, json[i].title] // i is not defined?
}
})
}