Skip to content

Instantly share code, notes, and snippets.

@appoll
Created November 21, 2022 19:33
Show Gist options
  • Save appoll/870f3f3b08b9916f5e32db0892b343c0 to your computer and use it in GitHub Desktop.
Save appoll/870f3f3b08b9916f5e32db0892b343c0 to your computer and use it in GitHub Desktop.
// E7.
// Start with 2 hardcoded arrays, e.g. prices1 & prices2
// Calculate a third array that contains the sum of the elements in the first two arrays.
prices1 = [12, 16, 24, 28]
prices2 = [1, 1, 1, 1]
pricesSum = []
for (i=0; i < prices1.length; i++){
}
console.log("Result: " + pricesSum);
// expected result: [13, 17, 25, 29]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment