Nodejs Utililty Methods Array Remove Item

List of utility methods to do Array Remove Item

Description

The list of methods to do Array Remove Item are organized into topic(s).

Method

remove(item)
Array.prototype.remove = function (item) {
  var i = this.indexOf(item);
  if (i != -1)
    this.splice(i, 1);
};
remove(item)
Array.prototype.remove = function(item) {
  var index = this.indexOf(item);
  if (index !== -1) {
    this.splice(index, 1);
};
remove(item)
Array.prototype.remove = function (item) {
    var i = 0;
    for(i = 0; i < this.length; i++) {
        if(this[i] == item)
            break;
    this.splice(i, 1);
remove(item)
Array.prototype.remove = function(item) {
  var j = 0;
  while (j < this.length) {
    if (this[j] == item) {
    this.splice(j, 1);
    } else { j++; }
};
remove(item)
Array.prototype.remove = function(item) {
    var idx = this.indexOf(item);
    if( idx != -1 )
        this.splice(idx, 1);
    return this;
remove(item)
var sampleArray = [1, 2, 1, 4, 1, 3, 4, 1, 111, 3, 2, 1,'1'];
Array.prototype.remove = function (item) {
    while (this.indexOf(item) >= 0) {
        this.splice(this.indexOf(item), 1);
    return this;
};
console.log(sampleArray.remove(1));
remove(item)
Array.prototype.remove = function(item){
  var arr = this.slice(0);
  for(var i=0;i<arr.length;i++){
    if(arr[i] == item){
      arr.splice(i,1);
      i--;
  return arr;
...
remove(item)
Array.prototype.remove = function(item) {
  var i = $.inArray(item, this);
  if (i === undefined || i < 0) return undefined;
  return this.splice(i, 1);
};
remove(item)
Array.prototype.remove = function (item) {
    if (item == null)
        return;
    var index = -1;
    for (var i = 0; i < this.length; i++) {
        if (this[i] == item) {
            index = i;
            break;
    if (index >= 0)
        this.splice(i, 1);
};
remove(item)
Array.prototype.remove = function(item){
  var index;
  while(1){
    index=this.indexOf(item);
    if (index > -1) {
      this.splice(index, 1);  
        console.log(this);  
    }else{
      break;
...