⊗jstsPmTpDst 26 of 55 menu

Tuple Destructuring in TypeScript

A tuple, like an array, can be destructurized. Let's say we have a tuple like this:

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

Let's break it down into variables:

let [name, age] = user;

The following tuple is given:

let time: [number, number, number] = [12, 59, 59];

Break down the time pieces into separate variables.

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