Skip to content

Instantly share code, notes, and snippets.

@mharju
Created January 13, 2014 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharju/8407032 to your computer and use it in GitHub Desktop.
Save mharju/8407032 to your computer and use it in GitHub Desktop.
Ecom solution
function calculate(o){return _.foldl(o,function(a,b){a[b.vat]=b.price+(a[b.vat]||0);return a},{})}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment