Huh. I always thought that JS objects supported string and number keys separately, like lua. Nope!
[Documents]$ cat test.js
let testArray = [];
testArray[0] = "foo";
testArray["0"] = "bar";
console.log(testArray[0]);
console.log(testArray["0"]);
[Documents]$ jsc test.js
bar bar
[Documents]$They do, but strings that are numbers will be reinterpreted as numbers.
[edit]
let testArray = [];
testArray[0] = "foo";
testArray["0"] = "bar";
testArray["00"] = "baz";
console.log(testArray[0]);
console.log(testArray["0"]);
console.log(testArray["00"]);
Lua supports even functions and objects as keys:
Functions as keys is handy when implementing a quick pub/sub.