News from the Field
A channel with tips on modern AI development. Join!
⊗jsPmCdEO 124 of 504 menu
◀ ▶

Optionality of else construct in JavaScript

The construct else is optional. The following example will print a message to the console only if the value of the variable is 1. Otherwise, nothing will just happen:

let test = 1; if (test == 1) { console.log('+++'); }

Check if the variable test is equal to 10, then let's print 'yes'. Otherwise, let nothing happen.

← →
↑
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