자바스크립트에서 객체 타입 지정
객체는 'object'라는
자체 데이터 타입을 가집니다.
typeof 연산자를 사용해 확인해 봅시다:
console.log(typeof {}); // 'object'를 출력합니다
코드를 실행하지 말고 콘솔에 무엇이 출력될지 결정하세요:
console.log( typeof {x: 1, y: 2, z: 3} );
코드를 실행하지 말고 콘솔에 무엇이 출력될지 결정하세요:
console.log( typeof {} );
코드를 실행하지 말고 콘솔에 무엇이 출력될지 결정하세요:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj );
코드를 실행하지 말고 콘솔에 무엇이 출력될지 결정하세요:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj['x'] );