string equals in javascript code example
Example 1: less than or equal js
>= // greater than or equal
<= // less than or equal
> // greater than
< // less than
== // equals
=== // strictly equals
!= // not equals
!== // stricly not equals
Example 2: js ===
5 =='5' // true: ignores type
5 === '5' // false: includes type
Example 3: === javascript
// === means equal value and equal type
var x = 5
// true
x === 5
// false
x === "5"
Example 4: javascript compare strings
console.log(NaN===NaN);//false
Example 5: string comparison in javascript
console.log("10" == "10"); //True
console.log(parseInt(10) == 10); // True Best practice