美文网首页
5-javascript基础

5-javascript基础

作者: 梁王io | 来源:发表于2017-04-21 19:56 被阅读13次

    javascript基础

    javascript基础类型

    基本数据类型:String,boolean,Number,Symbol(ES6新增),Undefined, Null
    引用数据类型:Object
    基本数据类型中有两个为特殊数据类型: null, undefined
    js的常见内置对象:Date,Array,Math,Number,Boolean,String,Array,RegExp,Function..

    判断Object的方法

    Object.prototype.tostring.call()
    typeof ,但typeof对于数组也会返回Object (typeof一个函数会返回function)

    判断Array的方法

    Object.prototype.tostring.call()

    Object.prototype.toString.call(a)
    "[object Array]"

    也可以看构造器
    a.constructor == Array

    相关文章

      网友评论

          本文标题:5-javascript基础

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