What is the difference between null and undefined in JavaScript?

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

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

30条回答
  •  太阳男子
    2020-11-21 23:52

    As typeof returns undefined, undefined is a type where as null is an initializer indicates the variable points to no object(virtually everything in Javascript is an object).

提交回复
热议问题