compare two array javascript

JavaScript
var a1 = [1,false,2,3,"dude"];
var a2 = [1,false,2,3,"dude"];

//check if arrays are equal
if(JSON.stringify(a1) === JSON.stringify(a2)){
    //arrays are equal
}

Source

Also in JavaScript: