#javascript#判断类型的方法

1.判断类型的方法

1.typeof    alert(typeof a);

2.instanceof    alert(a instanceof Array);

3.constructor    a.constructor === Array

4.prototype    Object.prototype.toString.call(a) === '[object String]'

5.jQuery.type()    jQuery.type(undefined) === 'undefined'

猜你喜欢

转载自blog.csdn.net/G_wendy/article/details/80991731
今日推荐