Which comparison operator performs type coercion if the operands are of different types?
- == (Equality)
- === (Strict Equality)
- != (Inequality)
- !== (Strict Inequality)
The comparison operator == (Equality) performs type coercion if the operands are of different types. This means JavaScript will attempt to convert the operands to the same type before making the comparison. In contrast, === (Strict Equality) checks both value and type without coercion.
Loading...
Related Quiz
- Which keyword is used to declare a variable with block scope?
- Which method is used to convert a JSON response to a JavaScript object?
- You have a block of code that needs to be executed when multiple conditions are true. Which control structure should be used to optimize the code for readability and performance?
- How do you ensure that dynamically added elements maintain accessibility features, like ARIA roles?
- What is the primary use of the for...in loop in JavaScript?