js判断是否是数组的四种方法
方法一
// 使用instanceof:
[2,3] instanceof Array === true
方法二
// 使用constructor:
[2,3].constructor === Array
方法三
// 使用prototype:
Object.prototype.toString.call([2,3]) === "[object Array]"
方法四
// 使用es6:
Array.isArray([2,3]) === true