check if object is aray javascript code example
Example 1: if object is array javascript
Array.isArray(object);
Example 2: 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");
}