wrapped Array.prototype.slice in closure, to save on property access.
    local copy array is created using slice.
splice is used on copy array rather than delete on original array.
set original array to modified copy
spelling mistake in docs comment -_-