美文网首页
JavaScript-null和undefined

JavaScript-null和undefined

作者: Demetris | 来源:发表于2017-11-27 19:40 被阅读0次

    null和undefined

    [if !supportLists]1.[endif]null表示一个‘空’的值。

    。null和0以及空字符串‘’不同,0是一个数值,‘’表示长度为0的字符串

    [if !supportLists]2.[endif]undefined表示未定义

    [if !supportLists]3.[endif]事实上null和undefined区别不大,大多数情况使用null,undefined仅仅在判断函数参数是否传递情况下有用

    相关文章

      网友评论

          本文标题:JavaScript-null和undefined

          本文链接:https://www.haomeiwen.com/subject/zzadbxtx.html