check value is array or not in javascript code example
Example 1: if object is array javascript
Array.isArray(object);
Example 2: in javascript check is is an array or not
Array.isArray(yourItem)
Example 3: javascript check if in array
var extensions = ["image/jpeg","image/png","image/gif"];
if(extensions.indexOf("myfiletype") === -1){
alert("Image must be .png, .jpg or .gif");
}