Nodejs Array In inArray(p_val)

Here you can find the source of inArray(p_val)

Method Source Code

Array.prototype.inArray = function(p_val) {
   var l = this.length;
   for(var i = 0; i < l; i++) {
      if(this[i] == p_val) {
         return true;
      }/*from w  w w .  j  a va  2s  .  c  o  m*/
   }
   return false;
}

Related

  1. inArray(find, option)
    Array.prototype.inArray = function (find, option) {
        var length = this.length;
        for (var i = 0; i < length; i++) {
            if (option == "case-insensitive") {
                if (this[i].toLowerCase() == find.toLowerCase()) {
                    return true;
            if (this[i] == find) {
    ...
    
  2. inArray(i)
    Array.prototype.inArray= function(i){
        var _this = this;
        for(var x=0; x<_this.length; x++){
            if(_this[x]==i) return x;
        return -1;
    
  3. inArray(item)
    Array.prototype.inArray = function(item) {
      for(var i=0; i < this.length; i++) {
        if(item === this[i]) return true;
      return false;
    };
    
  4. inArray(needle)
    Array.prototype.inArray=function(needle){
        for(var i=0;i<this.length;i++){
          if(this[i]===needle){
            return true;
        return false;
    var arr=["red","blue","yellow"];
    ...
    
  5. inArray(needle)
    Array.prototype.inArray = function(needle) {
            for(var i=0; i < this.length; i++) {
                    if(this[i] === needle) {
                            return true;
            return false;
    
  6. inArray(val)
    Array.prototype.inArray = function(val) {
      var l = this.length;
      for(var i = 0; i < l; i++) {
        if(this[i] == val) {
          return true;
      return false;
    
  7. inArray(val)
    Array.prototype.inArray = function(val){
        for (var key in this){
            if(this[key] == val)
                return true;
        };
        return false;
    
  8. inArray(val)
    Array.prototype.inArray = function(val)
        return (this.indexOf(val) > -1)
    
  9. inArray(value)
    Array.prototype.inArray = function (value) {
      var i;
      for (i=0; i < this.length; i++) {
        if (this[i] === value) {
          return true;
      return false;
    };
    ...