I have an object that associates a key to an array of values. Eg.
var map = {
"600": [
"600",
"0"
],
"602": [
"600",
"0"
],
"6723": [
"6646",
"600",
"0"
],
"6646": [
"600",
"0"
]
}
I noticed that Javascript will resolve a key when using an array for key lookup.
Eg.
map[600] => ["600","0"]
map[[600]] => ["600","0"]
map[[[600]]] => ["600","0"]
Curious about this inherent input flattening? Also when you pass multi-value array, JS will pick that last argument. But if nest arrays it returns undefined.
Eg.
map[600, 6723] => ["6646","600","0"]
map[[600, 6723]] => undefined
Any insights/links/docs for what is happening here? Thanks!