Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created September 5, 2016 23:42
Show Gist options
  • Save ericelliott/00d32233e855ef1903ba6a50b7d191d5 to your computer and use it in GitHub Desktop.
Save ericelliott/00d32233e855ef1903ba6a50b7d191d5 to your computer and use it in GitHub Desktop.
Composable utilities
const curry = fn => (...args) => fn.bind(null, ...args);
const map = curry((fn, arr) => arr.map(fn));
const join = curry((str, arr) => arr.join(str));
const toLowerCase = str => str.toLowerCase();
const split = curry((splitOn, str) => str.split(splitOn));
@jameswomack
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment