I'm developing a ReactJS app and have data stored in an array. The array is non-empty, but for some reason it insists that arr[0]
is undefined and arr.length
is 0.
Edit: here's the result of the following four lines:
console.log(JSON.stringify(this.state.arr));
console.log(this.state.arr);
console.log(this.state.arr.length);
console.log(this.state.arr[0]);