美文网首页
JavaScript typeof运算符

JavaScript typeof运算符

作者: 椰果粒 | 来源:发表于2019-06-27 19:35 被阅读0次

    只能区分值类型,不能区分引用类型,能区分出函数来。

    表达式
    typeof undefined 'undefined'
    typeof 'aaa' 'string'
    typeof 123 'number'
    typeof true 'boolean'
    typeof {} 'object'
    typeof [] 'object'
    typeof null 'object'
    typeof new RegExp() 'object'
    typeof new Number() 'object'
    typeof console.log 'function'

    相关文章

      网友评论

          本文标题:JavaScript typeof运算符

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