What is the difference between == and === operators?

== is the equality operator, which checks if the two values are equal or not. It doesn’t check the type of the two values. For example:

let a = 10;
let b = “10”;

console.log(a == b); // returns true

=== is the strict equality operator, which checks if the two values are equal and of the same type. For example:

let a = 10;
let b = “10”;

console.log(a === b); // returns false

What is the difference between == and ===?

== is the equality operator and is used to compare two values. It doesn’t check the data type of the two values being compared. For example:

let a = 10;
let b = “10”;
a == b // returns true

=== is the strict equality operator and is used to compare two values. It checks the data type of the two values being compared. For example:

let a = 10;
let b = “10”;
a === b // returns false