shank
Has the same functionality as Array.prototype.splice(), but returning a new array instead of mutating the original array.
- Use
Array.prototype.slice()andArray.prototype.concat()to get an array with the new contents after removing existing elements and/or adding new elements. - Omit the second argument,
index, to start at0. - Omit the third argument,
delCount, to remove0elements. - Omit the fourth argument,
elements, in order to not add any new elements.