JavaScript에서 객체로서의 배열
배열은 실제로 객체의 특별한
경우입니다. 이것은
typeof 연산자로 배열을 확인해보면
알 수 있습니다:
javascriptconsole.log(typeof []); // 'object'를 출력합니다
Задание 1
코드를 실행하지 않고, 콘솔에 무엇이 출력될지 결정하십시오:
javascriptconsole.log( typeof {x: 1, y: 2, z: 3} );
Задание 2
코드를 실행하지 않고, 콘솔에 무엇이 출력될지 결정하십시오:
javascriptconsole.log( typeof [1, 2, 3] );
Задание 3
코드를 실행하지 않고, 콘솔에 무엇이 출력될지 결정하십시오:
javascriptlet arr = [1, 2, 3];
console.log( typeof arr );
Задание 4
코드를 실행하지 않고, 콘솔에 무엇이 출력될지 결정하십시오:
javascriptlet arr = [1, 2, 3];
console.log( typeof arr[0] );
Задание 5
코드를 실행하지 않고, 콘솔에 무엇이 출력될지 결정하십시오:
javascriptlet arr = ['1', '2', '3'];
console.log( typeof arr[0] );