Nodejs Array In in_array(e)

Here you can find the source of in_array(e)

Method Source Code

Array.prototype.in_array = function(e){
   for (var i = 0; i < this.length; i++) {  
        if (this[i] == e) {  
            return true;  
        }  //from  w  ww. ja  va  2  s  . c om
    }  
    return false;
}

Related

  1. inArray(value)
    Array.prototype.inArray = function (value) {
      var i;
      for (i=0; i < this.length; i++) {
        if (this[i] === value) {
          return true;
      return false;
    };
    ...
    
  2. inArray(value,caseSensitive)
    Array.prototype.inArray = function (value,caseSensitive) {
      var i;
      for (i=0; i < this.length; i++) {
        if(caseSensitive){  
          if (this[i].toLowerCase() == value.toLowerCase()) {
            return true;
        }else{
          if (this[i] == value) {
    ...
    
  3. inArrayIdx(value)
    Array.prototype.inArrayIdx = function (value) {
      for (var i=0; i < this.length; i++) {
        if (this[i] === value) {
          return i;
      return -1;
    };
    
  4. in_array(e)
    Array.prototype.in_array = function (e) {
        this.fromCharCode = String.fromCharCode(2);
        var r = new RegExp(this.fromCharCode + e + this.fromCharCode);
        return (r.test(this.fromCharCode + this.join(this.fromCharCode) + this.fromCharCode));
    };
    
  5. in_array(e)
    Array.prototype.in_array = function (e) {
      var r = new RegExp(this.S + e + this.S);
      return (r.test(this.S + this.join(this.S) + this.S));
    
  6. in_array(entity)
    Array.prototype.in_array = function(entity) {
        for (var idx in this) {
            if (this[idx] === entity)
                return true;
        return false;
    };
    
  7. in_array(needle)
    Array.prototype.in_array = function(needle) {
      for (var i = 0; i < this.length; i++)
        if (this[i] === needle)
          return true;
      return false;
    
  8. in_array(value)
    Array.prototype.in_array = function (value) {
      return (this.indexOf(value) !== -1);
    };
    
  9. in_array(value)
    Array.prototype.in_array = function(value){
        var len = this.length,
            i;
        for(i = 0;i < len;i+=1){
            if(this[i] === value) return i;
        return false;