The JSON specification has no syntax for NaN, Infinity, or -Infinity, so JSON.stringify replaces each of these non-finite numbers with null. This means round-tripping such values through JSON loses information, a frequent gotcha when serializing computed numeric data that may produce NaN or Infinity.