⊗jsPmCdVC 108 of 504 menu

Variables comparison in JavaScript

In the examples above, we compared a variable and some number. But no one forbids us to compare two variables. See an example:

let test1 = 1; let test2 = 2; if (test2 > test1) { console.log('+++'); // it will work } else { console.log('---'); }

The variables test1 and test2 are given. Check value of which variable is greater and display the corresponding message.

The variables test1 and test2 are given. Check if their values are equal and display the corresponding message.

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