Here you can find the source of delete()
/**//from w w w . j a v a 2 s.c o m * @method delete * @param {Array} arguments[0] Array with items to remove from trigger array * @description Returns array without deleted items * @example [3,5,7].delete([2,7,4,3]); * @returns {Array} Array without deleted items. */ Array.prototype.delete = function() { var arr = this; var todel = arguments[0]; if(todel && todel instanceof Array) { var arraux = []; for(var i=0; i<todel.length;i++) { arr.some(function(el, j){ if(el == todel[i]){ arraux.push(j+''); }; return el == todel[i]; }); }; arraux = arraux.sort(); for(var i=arraux.length-1;i>=0;i--) { arr.splice(arraux[i],1); }; return arr; } else { return false; }; };
'use strict'; Array.prototype.delete = function (index) { delete this[index]; this.splice(index, 1); return this; };
Array.prototype.deleteAll = function(){ var arr = this; arr.splice(0,arr.length);
Array.prototype.deleteAt = function(index) { return this.splice(index, 1); };
Array.prototype.deleteItems = function (ids, filterEmpty = true) { var result = this.slice(); if (typeof ids === 'object' && ids.constructor === [].constructor) { ids.sort(function (a, b) { return b > a; }).forEach(function (value) { if (filterEmpty) { result.splice(value, 1); } else { ...