Created
May 30, 2018 10:49
-
-
Save khg0712/edf472e5b3f7aa3099ef305abf645c8f to your computer and use it in GitHub Desktop.
생성자 함수로 생성된 객체의 프로토타입 체이닝
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
function Animal(name, age, species) { | |
this.name = name; | |
this.age = age; | |
this.species = species; | |
} | |
var frog = new Animal('froll', 2, 'frog'); | |
console.log(frog.hasOwnProperty('name'));//true 출력 | |
console.log(frog.hasOwnProperty('fatherName'));//false 출력 | |
console.dir(Animal.prototype);//Animal.prototype 객체 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment