I'm fetching data with promise. I'm using this callback function to loop through the value.
selectedAppIdCalculator() {
this.fetchData2().then( value => {
console.log("value: ", value);
for (let app of value) {
console.log("in for loop");
}
});
}
The response value is not null, because it logs first the value. The value is a array with json objects.
But the for loop is never executed. Why?
In the debugging mode I noticed something weird.
The value is empty. Also the value in the log console is empty:

But when running normally it logs normally the response value. I'm really confused.

value?constin a for-of loop:const value = ['a', 'b', 'c']; for (const app of value) { console.log(app); }valueisn't an array... a common case would be where the array is deeper, i.e.value.someCollection. As Titian said, you need to share what is invalueso we can answer the question.