Why does String(null) work?
问题 null and undefined don't have a toString or valueOf method. Afaik using String calls the toString method of its parameter (e.g. String({}) => [object Object] ). Why do String(null) or String(undefined work then? It doesn't implicitly do Object.prototype.toString.call(null) . because that evaluates to [object Null] . [edit]: from the spec ECMA-262/5th edition (page 48). This doesn't add to clarification, I'd say: /* Table 13 — ToString Conversions ----------------------------------------------