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