Created
December 15, 2012 13:59
-
-
Save tomoh1r/4295258 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
'use strict'; | |
var Hoge = Object.create(null); | |
Hoge.x = 10; | |
var h = Object.create(Hoge); | |
var f = Object.create(Hoge); | |
console.log(h.x); | |
// => 10 | |
console.log(f.x); | |
// => 10 | |
Hoge.x = 20; | |
console.log(h.x); | |
// => 20 | |
console.log(f.x); | |
// => 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment