Nodejs Array Contain contain(arg)

Here you can find the source of contain(arg)

Method Source Code

Array.prototype.contain = function(arg){
   var i=0;//  w  w w . j  a v  a2s  .c  o  m
   var arrSize = this.length;
   for(i=0;i<arrSize;i++){
      if(this[i] == arg){
         return true;
      }
   }
   return false;
};

Related

  1. contain(obj)
    Array.prototype.contain = function(obj){
      for(var i=0;i<this.length;i++){
        if(this[i]==obj){
          return true;
      return false;
    };
    
  2. contains( func)
    Array.prototype.contains = function( func) {
      if( $.isFunction(func) ) {
        for( var i=0; i<this.length; i++ ) {
          var item = this[i];
          if( func(item) == true ) {
            return true;
        return false;
    ...
    
  3. contains( needle )
    Array.prototype.contains = function ( needle ) {
        for (i in this) {
            if (this[i] == needle) return true;
        return false;
    
  4. contains( needle )
    Array.prototype.contains = function ( needle ) {
       for (i in this) {
           if (this[i] == needle) return true;
       return false;