从ecma-262 规范文档 的角度解释标题的问题就非常简单。直接看为什么 JSON.stringify(NaN) => "null"NOTE 4Finite numbers are stringified as if by calling ToString(number). NaN and Infinity regardless of sign are represented as the String null.NaN 会被 当成字符串 null为什么 JSON.stringify(undefined) => undefinedJSON.stringify([undefined]) => "[null]"NOTE 5Values that do not have a JSON representation (such as undefined and functions) do not produce a String. Instead they produce the undefined value. In arrays these values are represented as the String null