Node.js examples for Array:Compare Array
Compare two array
Array.prototype.compareArrays = function(arr) { if (this.length != arr.length) return false; for (var i = 0; i < arr.length; i++) { if (this[i].compareArrays) { //likely nested array if (!this[i].compareArrays(arr[i])) return false; else continue;//from w ww. j a va 2 s. c om } if (this[i] != arr[i]) return false; } return true; };