⊗jstsPmTpRo 24 of 55 menu

Tuple Reader in TypeScript

You can create read-only tuples whose elements cannot be modified by specifying the readonly keyword before the tuple type:

let user: readonly [string, number] = ['john', 31];

Attempting to modify such a tuple will result in an error:

user[0] = 'eric'; //

Tell me what the result of running the following code will be:

let time: readonly [number, number, number] = [12, 59, 59]; time[0] = 13; console.log(time);
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