Method one: instanceof
instanceof is used to determine whether a variable is an instance of an object
var arr=[];
console.log(arr instanceof Array)
//返回true
Method 2: The constructor
constructor property returns a reference to the array function that created this object, that is, the constructor corresponding to the returned object
console.log([].constructor == Array)
Method 3: Array.isArray () is
used to determine whether the passed value is an Array. The value that
obj
needs to be checked, true if the object is Array; otherwise, false.
Array.isArray(obj)