Equality check (=== vs ==)

JavaScript is a scripting language, and variables are not assigned a type during declaration. Instead, types are interpreted as the code runs.

"= = =" checks for both the type(first) and the value, while "= =" checks only for the value.

Example:

if("5"==5)
{
	console.log('here, it is just Value check');
}

if("5"===5)
{
    console.log('\n Here, it is value & type check');
}
else
{
	console.log('\n above is false');
}

Output:
here it is just Value check
above is false

Note: The primitive equality check operators, "= =" and "= = =", can be used only for non-object types such as numbers, strings, and booleans. To implement an equivalence check for objects, each property in the object needs to be checked.

Comments