How to determine if an Object is an Array

1.constructor

The constructor property is the prototype member of every object that has a prototype

arr.constructor == Array //true means that arr is an array

2.isArray

arr.isArray()

3.length

4.prototype

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324775090&siteId=291194637