Nodejs Array Contain Contains( value )

Here you can find the source of Contains( value )

Method Source Code

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

Related

  1. containsBy(elem, formatElem, formatListElem)
    Array.prototype.containsBy = function(elem, formatElem, formatListElem) {
        formatElem = formatElem || function (elem) {return elem;};
        formatListElem = formatListElem || function (elem) {return elem;};
        var contained = false;
        angular.forEach(this, function(listElem){
            if(formatListElem(listElem) == formatElem(elem)){
                contained = true;
        });
    ...
    
  2. containsByProp(propName, value)
    Array.prototype.containsByProp = function(propName, value){
      for (var i = this.length - 1; i > -1; i--) {
        var propObj = this[i];
          if(propObj[propName] === value) {
            return true;
    return false;
    
  3. containsContentsOf(array)
    Array.prototype.containsContentsOf = function(array) {
        var contains = true;
        if(!array)
            contains = false;
        for(var item=0; item<array.length; item++){
            if(this.indexOf(array[item]) < 0)
                contains = false;
        return contains;
    ...
    
  4. containsDuplicateValues()
    Array.prototype.containsDuplicateValues = function () {
        var map = {};
        for (var i = 0, size = this.length; i < size; i++) {
            var value = this[i];
            if (value != 0) {
                if (map[value]) {
                    return true;
                map[value] = true;
    ...
    
  5. containsElementByProperty(chave,obj)
    Array.prototype.containsElementByProperty = function(chave,obj) {
        var i = this.length;
        while (i--) {
          if (angular.equals(this[i][chave], obj)) {
                return true;
        return false;
    };
    ...
    
  6. isContain(e)
    Array.prototype.isContain = function(e) {
      return this.indexOf(e) != -1;