⊗jsPmBsVrCh 15 of 504 menu

Variable value changes

Suppose we have a variable to which we have assigned some value. We can apply again the assignment operation then and assign an another value to this variable:

let a; // declare a variable a = 1; // assign the value 1 to it alert(a); // shows 1 a = 2; // now assign the value 2, overwriting the value 1 alert(a); // shows 2

That is, the value of a variable is not something rigidly attached to it. We can freely write some data to a variable, read it, then write something else - and so on.

Create the variable a. Assign the value 10 to it, display it on the screen. Then write the value 20 into it, display it on the screen.

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