Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function insertItem(array, action) {
- return [
- ...array.slice(0, action.index),
- action.item,
- ...array.slice(action.index)
- ]
- }
- function removeItem(array, action) {
- return [...array.slice(0, action.index), ...array.slice(action.index + 1)]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement