Compare two arrays - Node.js Array

Node.js examples for Array:Compare Array

Description

Compare two arrays

Demo Code

Array.prototype.equals = function (array) {
    for(var i = 0; i < this.length; i++){
        if(this[i] != array[i]){
            return false;
        }/*from   w w w . j a  v a  2  s  .  com*/
    }
    return true;
}

Related Tutorials