1. Home
  2. Computer Science MCQs
  3. Javascript
  4. What does console.log(0.1 + 0.2 === 0.3) print in…

Added 2 Nov 2026

What does console.log(0.1 + 0.2 === 0.3) print in JavaScript?

  1. true
  2. NaN
  3. false Correct answer
  4. undefined

Correct answer

C. false

15 views

MCQSEXAM

Explanation

JavaScript numbers are IEEE 754 binary floating-point values, and 0.1 + 0.2 equals 0.30000000000000004. Compare with a small tolerance, such as Number.EPSILON, instead.

Reference

Asked in: Frontend Developer Tests, Technical Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Javascript MCQs

Practise all Javascript MCQs

Similar MCQs