Created
February 13, 2018 16:02
-
-
Save kylefdoherty/2bd2190a324e2eac3433c33f5fe3b1d1 to your computer and use it in GitHub Desktop.
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
const immutableArray = [1, 2, 3, 4] | |
const index = 2 | |
const newArrayLess3 = [ | |
...immutableArray.slice(0, index), | |
...immytableArray.slice(index + 1), | |
] | |
# => newArrayLess3 = [1, 2, 4] | |
# => immutableArray = [1, 2, 3, 4] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment