Skip to content

Instantly share code, notes, and snippets.

@jung-han
Created March 28, 2018 09:29
Show Gist options
  • Save jung-han/c5642dd2da0aacfe7a473cba4f71ae0f to your computer and use it in GitHub Desktop.
Save jung-han/c5642dd2da0aacfe7a473cba4f71ae0f to your computer and use it in GitHub Desktop.
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); // ?
@ramason06
Copy link

false/true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment