Array contains Slice - Node.js Array

Node.js examples for Array:Array Operation

Description

Array contains Slice

Demo Code

Array.prototype.containsSlice = function(slice) {
  var retorno = false;

  for(i = 0; i < slice.length; i++) {
    if(!this.contains(slice[i])) {
      retorno = false;//from ww w .jav a2  s .c  o m
      break;
    } else {
      retorno = true;
    }
  }

  return retorno;
}

Related Tutorials