A strange behavior of array assignment at index: array[<some string>].
Let's say I have a normal array:
const arr = [1, 2, 3]; // undefined
If I type:
arr['.'] = 4; // 4
arr // (3) [1, 2, 3, .: 4]
arr.length // 3
for (a of arr) {
console.log(a)
// 1
// 2
// 3
}
Now I get some strange hybrid between an array and an object. If I try to spread the array into another variable:
const barr = [...arr] // (3) [1, 2, 3]
Does anyone know what is going on and what rules create this kind of behavior?