Objektų tipizavimas JavaScript
Objektai turi savo duomenų tipą,
kuris vadinamas 'object'.
Patikrinkime naudojant operatorių typeof:
console.log(typeof {}); // išves 'object'
Paleisdami kodą, nustatykite, ką išves konsolėje:
console.log( typeof {x: 1, y: 2, z: 3} );
Paleisdami kodą, nustatykite, ką išves konsolėje:
console.log( typeof {} );
Paleisdami kodą, nustatykite, ką išves konsolėje:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj );
Paleisdami kodą, nustatykite, ką išves konsolėje:
let obj = {x: 1, y: 2, z: 3};
console.log( typeof obj['x'] );