UNPKG

@extra-array/remove

Version:
9 lines (8 loc) 229 B
function index(x, i = 0) { return i < 0 ? Math.max(x.length + i, 0) : Math.min(i, x.length); } function remove(x, i) { var i = index(x, i); return x.slice(0, i).concat(x.slice(i + 1)); } export { remove as default };