less than or equal to symbol 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: javascript compare number to string
let string = "1";
let number = 1;
if (parseInt(string) === number){
// STRING AND NUMBER MATCHES
}
if (string == number){
// STRING AND NUMBER MATCHES ALSO BECAUSE == instead of ===, means it won't compare datasets, only the content
}
Example 3: less than or equal to javascript
if(a <= 5){
yourFunction();
}
Example 4: not equal to in js
let a=12
if(a!=5){
console.log(true)
}
since a is not equal to 5, it will print true