Javascript - Array Array Detecting

Introduction

Array.isArray() method definitively determine if a given value is an array:

if (Array.isArray(value)){
    //do something on the array
}

Demo

var colors = ["red", "blue", "green"];//define an array of strings
console.log(colors[0]);               //display the first item
colors[2] = "black";                  //change the third item
colors[3] = "brown";                  //add a fourth item

console.log(Array.isArray(colors));

Result