There is a property

var array = []; 

How can I verify that the array property is an Array type? Surely there is no one way and if possible, list them all.

    2 answers 2

    That is enough

     function is_array (a) { return (typeof a == "object") && (a instanceof Array); } 
    • @mountpoint: Thank you! - vas
    1. Array.isArray (a)
    2. a && (a instanceof Array)
    3. a && (a.constructor === Array)
    4. Object.prototype.toString.call (a) === '[object Array]'
    5. a && ((a.length> 0) && ('0' in a) || a.length === 0 &&! ('0' in a))

    Look like that's it.