Can someone explain what's going on in this JavaScript code:
let arr = [];
arr["foo"] = "11";
arr["sd"] = "12";
arr[1] = "13";
console.log(arr.length); //2
console.log(arr) // [empty, "13", foo: "11", sd: "12"]
Why is there an empty element in the array?
Also, why the Array length equals 2 and not 4?