[JS] 상속 , prototype

nana·2023년 1월 17일
0

🟡 JavaScript

목록 보기
23/23
post-thumbnail

🖍️ 상속 , prototype

💟

const user = {
  name: 'Mike',
};

user.name  // "Mike"
user.hasOwnProperty('name');  // true
user.hasOwnProperty('age');   // false
user
// {name: 'Mike'}
// name: "Mike"
// [[Prototype]]: Object
// constructor: ƒ Object()
// hasOwnProperty: ƒ hasOwnProperty()

📎 hasOwnProperty() : 메소드는 객체가 특정 프로퍼티를 가지고 있는지를 나타내는 불리언 값을 반환한다.


profile
✧ 중요한건 꺾이지 않는 마음 🔥 ᕙ(•ө•)ᕤ 🔥

0개의 댓글