Created
January 22, 2017 08:40
-
-
Save iddan/b3c49802eb766f70e1465f3aa19d70d4 to your computer and use it in GitHub Desktop.
Immutable Splice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function splice(array, ...args) { | |
let newArray = [...array]; | |
newArray.splice(...args); | |
return newArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment