I found this method:
Array.prototype.compare = function(arr) {
if (this.length != arr.length) return false;
for (var i = 0; i < arr.length; i++) {
if (this[i].compare) {
if (!this[i].compare(arr[i])) return false;
}
if (this[i] !== arr[i]) return false;
}
return true;
}
var a = ['aa',[1,2,3]]
var b = ['aa',[1,2,3]]
alert(a.compare (b))
.
But, when I make a deep compare, it returns false
.
So what method do you use to compare two arrays, using jquery?
Thanks