JavaScript中null、undefined有什么区别?

  • 赋值:null 表示定义了但未赋值,undefined 表示未定义
  • 数据转换:null 在做数值转换时会被转换为 0,undefined 会被转换为 NaN


原文链接
 


 

猜你喜欢

转载自www.cnblogs.com/ConstXiong/p/12065847.html