⊗jsPmBsVrM 14 of 504 menu

Declaring of multiple variables in JavaScript

Let's declare several variables:

let a = 1; let b = 2; let c = 3;

We can simplify the code above if we write let one time and listing then the required variables with their values after it, in such a way:

let a = 1, b = 2, c = 3;

You can first declare all variables, and then assign values to them:

let a, b, c; // declare all 3 variables // Assigning values to variables: a = 1; b = 2; c = 3;

Try all the described ways of declaring variables by yourself.

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