美文网首页
js高级程序设计笔记1

js高级程序设计笔记1

作者: ycyc1996 | 来源:发表于2018-03-26 21:05 被阅读0次

数据类型

1.undefined
2.null
3.number
4.boolean
5.string
6.object

判断数据类型

1.typeof

typeof 95 //  'number'
typeof  'aaa' //  'string'

#typeof可以判断function 

2.instanceof

alert(c instanceof Array)  //   true

#需要后面跟的是object,不然会报错

3.constructor

c.constructor === Array  //  true

4.prototype

alert(Object.prototype.toString.call(a) === ‘[object String]’) -------> true;

相关文章

网友评论

      本文标题:js高级程序设计笔记1

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