JavaScript null and undefined

• undefined means “no value” (neither primitive nor object). Uninitialized variables,
missing parameters, and missing properties have that nonvalue. And functions
implicitly return it if nothing has been explicitly returned.
• null means “no object.” It is used as a nonvalue where an object is expected (as a
parameter, as a member in a chain of objects, etc.).

貌似我之前理解反了。

posted @ 2014-04-12 15:14  LambdaTea  阅读(210)  评论(0编辑  收藏  举报