Created
April 17, 2016 08:28
-
-
Save DaniGithub/a3cfad677ad17913328f10ef80746aa4 to your computer and use it in GitHub Desktop.
Objects 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
var obj = { | |
a: "hello world", | |
b: 42 | |
}; | |
var b = "a"; | |
obj[b]; // "hello world" | |
obj["b"]; // 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment