Sometimes the simplest things become the most confusing.
let arr = ['x', 'y', 'z'];
for(let i = 0; i <= arr.length; i++) {
let prop = arr.shift();
console.log(prop);
console.log(arr, `${i} <= ${arr.length}`);
}
it prints out
x
[ 'y', 'z' ] '0 <= 2'
y
[ 'z' ] '1 <= 1'
How come 'z' doesn't show up with this code as part of the console.log(prop)?
shift.iis 2.