Created
June 20, 2016 16:28
-
-
Save carlosvega20/e75c96acb703513115bc02add33f6448 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 add = (list, item) => { | |
return […list, item] | |
} | |
const remove = (list, index) => { | |
return [ | |
…list.slice(0,index), | |
…list.slice(index+1) | |
] | |
} | |
const increment = (list, index) => { | |
return [ | |
…list.slice(0,index), | |
list[index] + 1, | |
…list.slice(index+1) | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment