What is the difference between null and undefined in JavaScript?

前端 未结 30 4196
夕颜
夕颜 2020-11-21 23:06

I want to know what the difference is between null and undefined in JavaScript.

30条回答
  •  感动是毒
    2020-11-21 23:50

    You might consider undefined to represent a system-level, unexpected, or error-like absence of value and null to represent program-level, normal, or expected absence of value.

    via JavaScript:The Definitive Guide

提交回复
热议问题