Getting something very odd happening with an array in my code. I have made a JS fiddle to demonstrate (you will have to open up your browsers console to see the logs).
I have also provided an image high lighting whats happening.
I would like some explanation as to why this might be happening.
Basically, an array of size 3 only shows 2 of the elements within the array. When i console log the array.length, it shows as 3, however upon opening the object only 2 elements are visible, something doesn't seem right here to me.
EDIT: I used the console log simply to show what was happening. My real issue is I cant access this 3rd element in the code, and I need to.
Please see the JS fiddle & image attached.
https://jsfiddle.net/ysf2o39f/
console.log('Init');
var arr = []; // Array of objects
var obj = {}; // Dummy object
// Fill array
arr.push(obj);
arr.push(obj);
arr.push(obj);
// Log
console.log('Before pop: ');
console.log(arr);
console.log('Length: ' + arr.length);
// Pop array
arr.pop();
// Log
console.log('After pop: ');
console.log(arr);
console.log('Length: ' + arr.length);