Array.prototype.remove = function (idx) {
return this.splice(idx, 1); // The second parameter is the number of elements to remove.
}
It'll attach this method remove to all objects created using Array object. Now you can remove any particular element using object.remove and passing index of array element (which you want to remove)
Array.prototype.remove = function (idx) {
return this.splice(idx, 1); // The second parameter is the number of elements to remove.
}