Uncaught ReferenceError: arrayName is not defined
at <anonymous>:2:15
at Object.InjectedScript._evaluateOn (<anonymous>:895:140)
at Object.InjectedScript._evaluateAndWrap (<anonymous>:828:34)
at Object.InjectedScript.evaluate (<anonymous>:694:21)
let arr = [0, 1, 2, 3, null, undefined,6]
delete arr[2]; // we delete element at index=2
if(2 in arr) console.log('You will not see this because idx 2 was deleted');
if(5 in arr) console.log('This is element arr[5]:', arr[5]);
// Whole array and indexes bigger than arr.length:
for(let i=0; i<=9; i++) {
let val = (i in arr) ? arr[i] : 'empty'
let bound = i<arr.length ? '' : '(out of range)'
console.log(`${i} value: `, val, bound);
}
console.log('Look on below aray on chrome console (not in SO snippet console)');
console.log('typeof arr:', typeof arr);
console.log(arr);