UNPKG
imma
Version:
latest (0.0.1)
0.0.1
A collection of functions for dealing with native arrays and objects immutably
imma
/
lib
/
array
/
splice.js
7 lines
(6 loc)
•
213 B
JavaScript
View Raw
1
2
3
4
5
6
7
'use strict'
const
splice =
module
.
exports
=
(
array, index, removeNum, ...values
) =>
{
const
head = array.
slice
(
0
, index)
const
tail = array.
slice
(index + removeNum)
return
head.
concat
(values, tail) }