Last active
July 15, 2018 20:23
-
-
Save adamgiese/64c1c49f995fb546a940fccfbc4ef3b3 to your computer and use it in GitHub Desktop.
Array Manipulation: Imperative Cart Total
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
var total = 0; | |
for (let index = 0; index < shoppingCart.length; index++) { | |
let currentItem = shoppingCart[index]; | |
total = total + currentItem.price * currentItem.quantity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment