Your product could be here, in front of thousands of JavaScript developers. Sponsor this spot →
JavaScript Quiz

JavaScript Numbers Quiz

Every number in JavaScript is a 64-bit IEEE 754 floating point value. That’s why 0.1 + 0.2 is not exactly 0.3, why NaN has the type "number", and why Infinity and -Infinity show up where you might not expect them.

These questions cover the corners of the Number type that trip up even experienced developers: precision errors, legacy number literals and the edge cases of the Math methods.

Numbers questions

  1. Why is typeof NaN "number" in JavaScript?
  2. Why does 018 - 015 equal 5 in JavaScript?
  3. Why is 0.1 + 0.2 == 0.3 false in JavaScript?
  4. Why is Math.max() < Math.min() true?
  5. What is -7 % 3 in JavaScript?
  6. Why does indexOf not find NaN but includes does?
  7. What is the difference between parseInt and Number?

More topics