Skip to content

Instantly share code, notes, and snippets.

@dtipson
Last active November 3, 2015 14:33
Show Gist options
  • Select an option

  • Save dtipson/40ad8ab4c7e554df8a66 to your computer and use it in GitHub Desktop.

Select an option

Save dtipson/40ad8ab4c7e554df8a66 to your computer and use it in GitHub Desktop.
R.reduce( (a,b) => a+b ,0)//sum
R.reduce( (a,b) => a+b ,"")//join strings
R.reduce( (a,b) => a.length > b.length ? a : b ,"")//return the longest string
R.reduce( (a,b) => {a[b]=b;return a;}} ,{})//create object of keys set to their values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment