What is the result of `5 == '5'`?
A
true B
false C
error D
undefined
Analysis & Theory
`==` allows type coercion, so 5 and '5' are considered equal.
What is the result of `5 === '5'`?
A
true B
false C
error D
undefined
Analysis & Theory
`===` checks both value and type. One is a number, the other a string.
What does `!=` do in JavaScript?
A
Checks if values are identical B
Checks if values and types are equal C
Checks if values are not equal (after type coercion) D
Checks for strict inequality
Analysis & Theory
`!=` checks for inequality after type coercion.
What is the result of `null == undefined`?
A
true B
false C
error D
NaN
Analysis & Theory
`null == undefined` is true because they are loosely equal.
What is the result of `null === undefined`?
A
true B
false C
error D
undefined
Analysis & Theory
`===` checks type too, so null and undefined are not strictly equal.
Which of the following expressions is true?
A
'5' === 5 B
0 == false C
null === null D
undefined == 'undefined'
Analysis & Theory
`null === null` is true. The rest are either loosely true or false.
What is the result of `true == 1`?
A
true B
false C
error D
undefined
Analysis & Theory
JavaScript converts `true` to 1 during loose comparison.
What is the result of `false === 0`?
A
true B
false C
undefined D
NaN
Analysis & Theory
Different types: boolean and number, so strict equality fails.
What does `!==` mean?
A
Not equal B
Strictly not equal (value or type mismatch) C
Greater than D
Less than
Analysis & Theory
`!==` means not strictly equal: checks both value and type.
What is the result of `'2' < 10`?
A
true B
false C
error D
NaN
Analysis & Theory
The string '2' is coerced to number 2, so 2 < 10 is true.