Objects have their own data type
called 'object'
. Check it with
the operator typeof
:
console.log(typeof {}); // shows 'object'
Without running the code, determine what will be output to the console:
console.log( typeof {x: 1, y: 2, z: 3} );
Without running the code, determine what will be output to the console:
console.log( typeof {} );
Without running the code, determine what will be output to the console:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj );
Without running the code, determine what will be output to the console:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj['x'] );