UNPKG

@extra-array/remove

Version:
10 lines (9 loc) 238 B
'use strict'; 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)); } module.exports = remove;