Pointing to object in array giving me an undefined error in console.log
I have no clue why line 58 is giving me an error as undefined
2 Replies
why the recursion?
and I think this is an issue of the reference being passed to the console
which is why 57 works and 58 doesn't
Yea when it initially logs the array is empty since the callback function has not actually run yet. But devtools when logging objects and arrays will keep the reference to that obj/array and update what is display. However when accessing the index of an array it doesn’t update
When you first initially print the array it would be an empty array, once the callback runs and updates the array, the console also updates as it links back to the reference of the array
the console logs happen before the callback is fired at all