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 you Now!!!!!
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 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