What is the result of 0.1 + 0.2 === 0.3 in JavaScript?

JavaScript Associate Easy

JavaScript Associate — Easy

What is the result of 0.1 + 0.2 === 0.3 in JavaScript?

Key points

  • JavaScript's floating-point arithmetic can lead to unexpected results.
  • Comparing floating-point numbers for equality requires caution.
  • Always be aware of precision errors when working with decimal numbers in JavaScript.

Ready to go further?

Related questions