Nodejs Array Remove remove_value(value)

Here you can find the source of remove_value(value)

Method Source Code

/**/*from  w w w  .  j ava 2  s .  c om*/
 * Removes all entries with a specific value.
 * @param value
 */
Array.prototype.remove_value = function(value){
    var len = this.length,
        i;
    for(i = 0;i < len;i+=1){
        if(this[i] === value){
            this.splice(i,1);
            i-=1;
        }
    }
}

Related

  1. removeRange(start, end)
    Array.prototype.removeRange = function(start, end){
      this.splice(start, end-start);
    
  2. removeSame()
    Array.prototype.removeSame = function() {
      let theNewArray = [];
      this.map((value, index, array) => {
        if (array.indexOf(value) === index) {
          theNewArray.push(value);
      });
      return theNewArray;
    };
    ...
    
  3. removeWhere(property, value)
    Array.prototype.removeWhere = function (property, value) {
        "use strict";
        for(var i = 0; i < this.length; i++) {
            if(this[i][property] === value) {
                this.splice(i, 1);
                break;
    };
    ...
    
  4. remove_(integer_list, value_list)
    Array.prototype.remove_ = function(integer_list, value_list) {
      return integer_list.filter( function(i) {
        return !value_list.some(function(v) {
          return v === i;
        });
      });
    var l = []
    var integer_list =  [1, 1, 2 ,3 ,1 ,2 ,3 ,4]
    ...
    
  5. remove_(integer_list, values_list)
    Array.prototype.remove_ = function(integer_list, values_list){
    var arr = integer_list;
    var newarr;
    function list (integers_list, value) {
      for (var j = 0; j<integers_list.length; j++) {
          if (value!==integers_list[j]) {
            newarr.push(integers_list[j]);
        return newarr;
      for (var i = 0; i<values_list.length; i++) {
        newarr = [];
        arr = list(arr, values_list[i])
      return arr;
    
  6. removerNaPosicao(index)
    Array.prototype.removerNaPosicao = function(index) {
      return this.splice(index, 1);
    };