how to compare two variables value in if statemnet in javascript code example
Example 1: equal to or more than javascript
//Equal to or more than
a >= b
//Equal to or less than
a <= b
Example 2: === javascript
// === means equal value and equal type
var x = 5
// true
x === 5
// false
x === "5"
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");
}