⊗jsPmObAAO 97 of 505 menu

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:

console.log(typeof []); // will output 'object'

Without running the code, determine what will be displayed in the console:

console.log( typeof {x: 1, y: 2, z: 3} );

Without running the code, determine what will be displayed in the console:

console.log( typeof [1, 2, 3] );

Without running the code, determine what will be displayed in the console:

let arr = [1, 2, 3]; console.log( typeof arr );

Without running the code, determine what will be displayed in the console:

let arr = [1, 2, 3]; console.log( typeof arr[0] );

Without running the code, determine what will be displayed in the console:

let arr = ['1', '2', '3']; console.log( typeof arr[0] );
Afrikaans
AzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEnglishEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
Ons gebruik koekies vir die werking van die webwerf, ontleding en personalisering. Die verwerking van data geskied volgens die Privaatheidsbeleid.
aanvaar alles instel verwerp