Skip to content

Instantly share code, notes, and snippets.

@firehawk895
Created January 16, 2017 13:47
Show Gist options
  • Save firehawk895/49a607922c0d02776980e7b533e69fa7 to your computer and use it in GitHub Desktop.
Save firehawk895/49a607922c0d02776980e7b533e69fa7 to your computer and use it in GitHub Desktop.
Grofers expense calculator
the_json.carts.forEach(function(cart) {
total_cost = cart.total_cost | 0
cashback = cart.cashback.applied_value | 0
refund = cart.refund.applied_value | 0
total = total + total_cost - cashback - refund
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment