Created
November 11, 2016 09:09
-
-
Save wuliupo/211f09572fdc1924a92339e722203108 to your computer and use it in GitHub Desktop.
property extended from parent
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 parentObj = {a:2}; | |
| var sunObj = Object.create( parentObj ); | |
| parentObj.a; // 2 | |
| sunObj.a; // 2 | |
| parentObj.hasOwnProperty( "a" ); // true | |
| sunObj.hasOwnProperty( "a" ); // false | |
| sunObj.a++; // block mode | |
| parentObj.a; // 2 | |
| sunObj.a; // 3 | |
| sunObj.hasOwnProperty("a"); // true ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment