yuzunsang / JS-deep-dive-study

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

[CH21]빌트인 객체 #34

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 str = "QWER";

console.log(str.toLowerCase()); // qwer

console.log(typeof str); // string

원시값을 객체처럼 접근할 때 자바스크립트 엔진에서 암묵적인 임시 객체로 변환한다. 이 임시 객체를 🟩 라고 한다.

🟩로 프로퍼티 접근 / 메서드 호출 후 다시 원시값으로 되돌린다.

정답
래퍼 객체 (wrapper object)
J-yun-ji commented 3 months ago

Q. 아래 코드의 실행 결과는 ?

const hello = 'bye'; 

hello.name = 'canvas'; 
console.log(hello.name); 
정답
undefined