⊗jsPmObMst 103 of 504 menu

Finding errors in code with objects in JavaScript

In the following problems, some programmer has written code and may have made mistakes in it. You should check if the code does what is described. If the code does not work correctly, you need to fix the errors.

The code should output the element of the object:

let obj = {x: 1, y: 2, z: 3}; console.log(obj[x]);

The code should output the object element by key from the variable:

let obj = {x: 1, y: 2, z: 3}; let key = 'x'; console.log(obj.key);

The code should output the sum of the object elements:

let obj = {x: 1, y: 2, z: 3}; let sum = obj[x] + obj[y] + obj[x]; console.log(obj);

The code should output the number of elements of the object:

let obj = {x: 1, y: 2, z: 3}; console.log(obj.length);
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline