chroline
12/1/2018 - 11:56 PM

Simple array function that removes element at specified index from array.

Simple array function that removes element at specified index from array.

/**
 * @param {number} index  The index at which the element should be removed
 * @returns The original array without the element at specified index
 */

Array.prototype.remove = function(index) {
  return this.splice(index, 1);
};