Last active
October 24, 2016 10:30
-
-
Save DmitryMasley/3a1cc6edf290f5daa8c66069d95512cb to your computer and use it in GitHub Desktop.
test
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
// what will output console.log? | |
// how to fix the issue? | |
function Person (name) { | |
if (name) { | |
this.options.name = name; | |
} | |
}; | |
Person.prototype.options = { | |
name: 'Default name' | |
}; | |
var foo = new Person('foo'); | |
var bar = new Person('bar'); | |
console.log(foo.options.name); | |
console.log(bar.options.name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment