Last active
February 18, 2017 21:52
-
-
Save halan/9b6480b5abcd8833d766452bcfa4e95a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const totalLine = line => line.quantity * line.price; | |
const sumTotal = lines => { | |
let total = 0; | |
for(let i = 0; i < lines.length; i++) { | |
total += totalLine(lines[i]) | |
} | |
return total; | |
} | |
console.log(sumTotal(lineItems)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment