js string equals 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 not equal

0 !== "0"
0 !== 0

Example 3: how to compare two strings in javascript if condition

var string1 = "Hello World";
var string2 = "Hello world.";
if (string1 === string2) {
  console.log("Matching strings!");
}
else {
  console.log("Strings do not match");
}