Created
December 18, 2019 13:29
-
-
Save DScheglov/b9e0603fa8646921c8649ebebfe50a87 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 get = items => index => items[index]; | |
const push = items => item => { items.push(item); }; | |
const pop = items => () => items.pop(); | |
const arrayApi = items => Object.assign( | |
get(items), { | |
push: push(items), | |
pop: pop(items), | |
} | |
); | |
export const array = () => arrayApi([]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment