Created
November 17, 2017 16:30
-
-
Save oliverturner/ccd1757c763e4383ad55e4d4769b4b1a 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 clone = (x) => [...x] | |
const push = (y) => (x) => [...x, y] | |
const pop = (x) => x.slice(0, -1) | |
const unshift = (y) => (x) => [y, ...x] | |
const shift = (x) => x.slice(1) | |
const sort = (fn) => (x) => x.sort(fn) | |
const delete = (i) => (x) => [...x.slice(0, i), ...x.slice(i + 1)] | |
const splice = (s, c, ...y) => x => [...x.slice(0, s), ...y, ...x.slice(s+c)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment