In Python I could do something like myMap = {key: [value1, value2]} and then access the value2 using myMap[key][1]
myMap = {key: [value1, value2]}
value2
myMap[key][1]
Can I do som
Yes, and the syntax is almost the same too.
var myMap = {key: ["value1", "value2"]}; alert(myMap["key"][1]); // Pops up an alert with the word "value2"
You can also use the following notation:
myMap.key[1]