Created
March 28, 2018 09:29
-
-
Save jung-han/c5642dd2da0aacfe7a473cba4f71ae0f 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
function Person(){} | |
Person.prototype.name = "hanjung"; | |
Person.prototype.age = 27; | |
Person.prototype.getName = function(){ | |
return this.name; | |
} | |
var inst1 = new Person(); | |
console.log(inst1.name); | |
Person.prototype = { | |
name: "doojung", | |
age: 28 | |
}; | |
var inst2 = new Person(); | |
console.log(inst2.name); | |
console.log(inst1 instanceof Person); // ? | |
console.log(inst2 instanceof Person); // ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
false/true