reddensoft
Banned-Spam
- Oct 7, 2022
- 84
- 8
What is the use of === operator in Javascript?
Just like this, example:The === operator is used in JavaScript to compare the values of two operands. It checks if the operands have the same value and also checks if they have the same type. This is known as strict equality, and it is different from the == operator, which only checks for value equality and does not check for type.
The = is simply an assignment to a variable.
console.log(1 == "1"); // true, because the values are equal
console.log(1 === "1"); // false, because the types are not equal