Q
What will be the output of 5 == true in JavaScript?

Answer & Solution

Answer: Option B
Solution:
JavaScript converts true to 1 before comparison. Since 5 is not equal to 1, the result is false.
Related Questions on Average

How does JavaScript evaluate null === undefined?

A). 1

B). 0

C). NaN

D). undefined

What does '5' !== 5 evaluate to in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

What will be the output of 5 === 5 in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

What will be the output of 5 >= 5 in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

How does JavaScript evaluate 5 <= 4?

A). 1

B). 0

C). NaN

D). undefined

What will be the output of 10 != '10' in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

How does JavaScript evaluate 'true' == true?

A). 1

B). 0

C). NaN

D). undefined

What is the result of NaN == NaN in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

What is the result of 5 == '5' in JavaScript?

A). 1

B). 0

C). NaN

D). undefined

How does JavaScript evaluate 0 == false?

A). 1

B). 0

C). NaN

D). undefined