Nodejs Array Include includes(array)

Here you can find the source of includes(array)

Method Source Code

Array.prototype.includes = function(array) {
  for ( var i = 0; i < this.length; i++) {
    for ( var k = 0; k < array.length; k++) {
      if ( this[i] == array[k]) {
        return true;
      }/*from  w  ww.  j a v  a2s  . c  om*/
    }
  }
  return false;
};

Related

  1. include(object)
    Array.prototype.include = function (object) {
      return this.filter((value) => {
        return JSON.stringify(value) === JSON.stringify(object);
      }).length > 0;
    };
    
  2. include(val)
    Array.prototype.include = function(val) {
      return this.index(val) !== null;
    };
    
  3. include(value)
    Array.prototype.include = function(value){
      return(this.indexOf(value) != -1);
    };
    
  4. include(value)
    Array.prototype.include = function(value){
      return this.indexOf(value) !== -1;
    
  5. include(x)
    Array.prototype.include = function(x){
      return this.indexOf(x) > -1
    
  6. includes(element)
    Array.prototype.includes = function(element) {
      return this.indexOf(element) !== -1;
    };
    
  7. includes(item)
    Array.prototype.includes = function(item) {
        return this.indexOf(item) > -1;
    
  8. includes(matcher)
    Array.prototype.includes = function(matcher) {
      var includes = false
        , arr = this;
      for( var j = 0, str; str = arr[j++]; ) {
        if( typeof str === "string" && str.includes(matcher) ) {
          includes = true;
      return includes;
    ...
    
  9. includes(s)
    Array.prototype.includes = function(s) {
        return this.indexOf(s) > -1;
    };