Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
⊗jsPmCdECh 106 of 504 menu

Checking for equality in JavaScript

To check two values for equality, use the operator ==. Let's check for example that the variable test is equal to 0:

let test = 0; if (test == 0) { console.log('+++'); // it will work } else { console.log('---'); }

Change the variable value so that the condition is not met:

let test = 1; if (test == 0) { console.log('+++'); } else { console.log('---'); // it will work }

Check if the variable test is equal to 10.

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