Difference between == VS ===

const Num1 = 1;
const Num2 = 1;
console.log(Num1 == Num2); //output is true
console.log(Num1 === Num2); // output is true
๐ก Now you will say, Whatโs new in this!!!!
**const Num1 = 1;
const string = โ1โ; // string is here
console.log(Num1 == Num2); // True
console.log(Num1 === Num2); // False**
Let me explain to you Now!!!!!
\== called a Double Operator, Known as Equality or abstract Comparison
\=== called as Triple Operator, Known as Identity or Strict Comparision
Performance is totally irrelevant, == vs === is faster is a myth
== converts the variable values to the same type before performing the comparison.
const num = 1;
const num1 = โ1โ;
console.log(num == num1); // Returns TRUE
๐ก // This returns true as it is converted the type, And so if it is false also it returns True
=== does not do any type of conversion (coercion) and returns true
only if both values and types are identical for the two variables
const num = 1;
const num1 = โ1โ;
console.log(num == num1); // Returns FALSE
๐ก // This returns False, as the type remains Identical




