Created
July 26, 2012 17:37
-
-
Save ychaouche/3183392 to your computer and use it in GitHub Desktop.
This file contains 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
//1 | |
obj = {key:value}; | |
//2 | |
obj = Object.create(null); | |
obj[key] = value; | |
//3 | |
obj = Object.create(null); | |
Object.defineProperty(obj,"key",{value:value, flags...}); | |
//variante | |
Object.defineProperties(obj,{key1 : {value:value, flags...}, key2 : {value:value, flags...}}); | |
//4 | |
obj = Object.create(null); | |
obj.key = value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment