nan output in javascript code example Example 1: javascript nan NaN = Not a number. Example 2: nan in js var val = Number.NaN;