-
A.
Both x and y are equal in value, type and reference address as well.
-
B.
Both are x and y are equal in value only.
.
-
C.
Both are equal in the value and data type.
-
D.
Both are not same at all
Correct Option: CExplanation:
The === operator is known as the strict equality operator in JavaScript.
It is used to test whether two values are equal, and it returns true if the values are equal and their types are the same.
For example:
console.log(1 === 1); // Output: true
console.log('1' === 1); // Output: false
In the first example, the === operator returns true because both operands are equal and have the same type (number).
In the second example, the === operator returns false because although the operands are equal in value, they have different types (string and number).
The strict equality operator is often used as an alternative to the == operator, which is known as the abstract equality operator.
The == operator performs type coercion, which means it converts the operands to the same type before making the comparison.
This can lead to unexpected results in some cases, so the === operator is generally considered a safer choice.