What is the result of the following JavaScript code snippet? console.log(0.1 + 0.2 === 0.3);

Web Development Medium

Web Development — Medium

What is the result of the following JavaScript code snippet? console.log(0.1 + 0.2 === 0.3);

Key points

  • Floating-point math in JS is imprecise
  • IEEE 754 standard causes binary representation errors
  • Strict equality checks fail on floating-point sums

Ready to go further?

Related questions