Nodejs Array Type Check isArray(input)

Here you can find the source of isArray(input)

Method Source Code

/**/*from  ww w  .j  a  va  2  s.co  m*/
 *
 * @param input
 * @returns {boolean}
 */
function isArray(input) {
    return Object.prototype.toString.call(input) === '[object Array]';
}

Related

  1. isArray(n)
    function isArray(n) {
       return n instanceof Array;
    
  2. isArray(o)
    function isArray(o) {
      return Object.prototype.toString.call(o) === '[object Array]';
    
  3. isarray(a)
    function isarray(a)
        return typeof a == 'object' &&
            typeof a.length == 'number' &&
            isFinite(a.length) &&
            a.length == Math.floor(a.length)
    
  4. isarray(e)
    function isarray(e) {
      return (e.length && typeof e !== "string");