Arrays as Objects in JavaScript
Arrays are actually a special
case of objects. This can be confirmed
by checking an array with the
typeof operator:
javascriptconsole.log(typeof []); // will output 'object'
Задание 1
Without running the code, determine what will be displayed in the console:
javascriptconsole.log( typeof {x: 1, y: 2, z: 3} );
Задание 2
Without running the code, determine what will be displayed in the console:
javascriptconsole.log( typeof [1, 2, 3] );
Задание 3
Without running the code, determine what will be displayed in the console:
javascriptlet arr = [1, 2, 3];
console.log( typeof arr );
Задание 4
Without running the code, determine what will be displayed in the console:
javascriptlet arr = [1, 2, 3];
console.log( typeof arr[0] );
Задание 5
Without running the code, determine what will be displayed in the console:
javascriptlet arr = ['1', '2', '3'];
console.log( typeof arr[0] );