Skip to content

Instantly share code, notes, and snippets.

View akajumi's full-sized avatar

akaJumi akajumi

  • Adimedia Comunicación Interactiva
  • Irun, Gipuzkoa - Euskadi
View GitHub Profile
@akajumi
akajumi / order-total.js
Created November 27, 2017 20:37 — forked from mpj/order-total.js
Code from Unit testing in JavaScript Part 3 - Test runners
function orderTotal(order) {
return order.items.reduce((prev, cur) => cur.price * (cur.quantity || 1) + prev, 0)
}
module.exports = orderTotal