Last active
December 16, 2015 03:49
-
-
Save binnng/5372523 to your computer and use it in GitHub Desktop.
Object.create创建对象, 疑惑的地方。具体看代码
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 O = {a: 1}; | |
| var n = Object.create(O, { | |
| a: { | |
| value: 2 | |
| } | |
| }); | |
| console.log(n); //{a: 1} | |
| console.log(n.a); //2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
enumerable: true