yuzunsang / JS-deep-dive-study

자바스크립트 딥 다이브 스터디✨
0 stars 3 forks source link

[CH19]프로토타입 #26

Open yuzunsang opened 3 months ago

yuzunsang commented 3 months ago

[퀴즈 예시] Q. 여기에 퀴즈 설명을 적으세요.

적을 코드가 있다면 밑에 적어주세요. (백틱 3개로 코드를 감싸면 코드 양식을 적을 수 있습니다.)

// 예시 코드
const arr = [1, 2, 3];
console.log("Hello");

아래 코드를 복붙해서 정답을 적어주세요.

<details>
    <summary>정답</summary>
    <div markdown="1">    
    정답 설명
    </div>
</details>
yuzunsang commented 3 months ago

Q. ??? 안에 들어갈 코드는?

const phoneNumber = {
    "Seoul": "02",
    "Gyeong-gi": "031",
    "Chung-buk": "043"
};

for (???) {
    console.log(`${key} : ${phoneNumber[key]});
}
정답
let key in phoneNumber
또는, const key in phoneNumber
J-yun-ji commented 3 months ago

Q. 아래의 경우에서 __proto__접근자 프로퍼티 대신 사용을 권장하는 메서드는?

1) 프로토타입의 참조를 원할 때 2) 프로토타입의 교체를 원할 때

정답
1) Object.getPrototypeOf
2) Object.setPrototypeOf