Skip to content

Instantly share code, notes, and snippets.

@adamgiese
Last active July 15, 2018 20:23
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 adamgiese/64c1c49f995fb546a940fccfbc4ef3b3 to your computer and use it in GitHub Desktop.
Save adamgiese/64c1c49f995fb546a940fccfbc4ef3b3 to your computer and use it in GitHub Desktop.
Array Manipulation: Imperative Cart Total
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