Created
January 19, 2019 23:04
-
-
Save Tombarr/5d1dc291fc3ad4253ac98b942c097a69 to your computer and use it in GitHub Desktop.
Objects as maps in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let map = { | |
red: "blue", | |
1: 2, | |
true: false | |
}; | |
map[true]; // false | |
map["red"]; // "blue" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment