1 //variables can include any letter, any number, or the underscore
2 //NO SPACES!!! USE UNDERSCORES!!!
3 //variable names are case sensitive
4 //example:
5var change_this = 'whatever you want here'
6 //change_this is a variable (change it to your variable name)
7 //'whatever you want here' is a string (you'll learn about this later)
8
1var a = [1, 3, 4, 3]
2var b = [1, 5, 6, 7]
3var c = [3, 4, 8, 9]
4
5function arraySum(x, varName) {
6 var sum = 0
7 for (let i = 0; i < x.length; i++) {
8 sum += x[i]
9 }
10 console.log("sum of " + varName + " is " + sum)
11}
12
13arraySum(a, "a");