3中判断类型的方法

typeof  不能判断 arr  undefined  null ...

1.arr.constructor==Array

2.arr instanceof Array

3.Object.prototype.toString.call(arr)=='[object Array]'

原文地址:https://www.cnblogs.com/zhengyan/p/4789737.html