A Weird Thing with NaN

David Germain
3 min readJul 17, 2019

At work we encountered a problem with NaN. For those who do not know, NaN stands for not-a-number. It represents when a computer cannot get a number from a mathematical operation.

Here are some different situations with JavaScript that can result in NaN:

  • Creating a number too big for the computer.
  • Dividing a number by a string.
  • Failing to convert…