nodejs comparison operators code example
Example 1: javascript compare number to string
let string = "1";
let number = 1;
if (parseInt(string) === number){
}
if (string == number){
}
Example 2: not equal to sign in js
let a=12
if(a!=5){
console.log(true)
}
since a is not equal to 5, it will print true
Example 3: js comparison operators
Javascript Comparison Operators
== Equal to
=== Equal value and equal type
!= Not equal
!== Not equal value or not equal type
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
? Ternary operator