Earlier than understanding the distinction between โ==โ vs โ===โ in JavaScript lets learn about what are the == and != operator.
== vs !=
so the double equals (==) operator use to verify if two values are equals and never equals (!=) if the 2 values are usually not equal
and its return kind is all the time boolean like true **or **false.
In == and != each operater do kind conversion earlier than evaluating the weather For e.g : โ 2 == โ2โ so on this == function do kind conversion implicitly like earlier than evaluating itโll do implicitly kind coercion like 2 == Quantity(โ2โ) after which itโll present output as *true **so that is what occurs after we compares utilizing == operater earlier than displaying output it add string โ2โ worth in quantity fucntion and convert into quantity 2 and the evaluatingโs we get the output as a real which 2 == 2
**for E.g *
let xxx = 2;
let xxxx = '2';
console.log(xxx == xxxx);// true
Now Verify with === operater can also be referred to as as strictly equality operator thats means it wonโt do any kind conversion internally
For E.g:
let x = 1;
let y = '1'
console.log(x===y)// output will false