Nodejs Array In inArray(value)

Here you can find the source of inArray(value)

Method Source Code

/* patForms::Rule::ValidValues */

Array.prototype.inArray = function(value) {
   var i;//ww w.  j  a v a 2  s  . c om
   for (i=0; i < this.length; i++) {
      if (this[i] === value) {
         return true;
      }
   }
   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)
    Array.prototype.inArray = function (value) {
      for (var i=0; i < this.length; i++) {
        if (this[i] === value) {
          return true;
      return false;
    };
    
  3. inArray(value)
    Array.prototype.inArray = function (value)  {
      var i;
      for (i=0; i < this.length; i++) {
        if (this[i] == value) {
          return true;
      return false;
    };
    ...
    
  4. inArray(value)
    Array.prototype.inArray = function (value) {
      for (var i=0; i < this.length; i++) {
        if (this[i] === value) {
          return true;
      return false;
    };
    
  5. inArray(value)
    Array.prototype.inArray = function(value) {
        var index = this.indexOf(value);
        if (index != -1) {
            return true;
        return false;
    
  6. inArray(value)
    Array.prototype.inArray = function(value) {
      var result = false;
      if(value) {
        for(var i=0; i<this.length; i++) {
          if(value == this[i]) {
            result = true;
            break;
      return result;
    };
    
  7. inArray(value)
    Array.prototype.inArray = function (value) {
      var i;
      for (i=0; i < this.length; i++) {
        if (this[i] === value) {
          return true;
      return false;
    };
    ...
    
  8. 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) {
    ...
    
  9. inArrayIdx(value)
    Array.prototype.inArrayIdx = function (value) {
      for (var i=0; i < this.length; i++) {
        if (this[i] === value) {
          return i;
      return -1;
    };