What will be the result of the following JavaScript expression ?…

2023

What will be the result of the following JavaScript expression ?
console.log(0.1 + 0.2 === 0.3);

Answer: A. falseIn JavaScript, decimal fractions such as 0.1 and 0.2 are stored in binary floating-point form. Their sum is not represented exactly as 0.3, so the strict…

  1. A.

    false

  2. B.

    undefined

  3. C.

    true

  4. D.

    NaN

Attempted by 55 students.

Show answer & explanation

Correct answer: A

In JavaScript, decimal fractions such as 0.1 and 0.2 are stored in binary floating-point form. Their sum is not represented exactly as 0.3, so the strict comparison returns false.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…