Iterate Through an Array with a For Loop

PHOTO EMBED

Tue Apr 26 2022 14:09:47 GMT+0000 (Coordinated Universal Time)

Saved by @Luduwanda #javascriptreact

const myArr = [2, 3, 4, 5, 6];
let total = 0

for(let i = 0; i < myArr.length; i++){
  total += myArr[i]
}

//Mind: dont use ".length-1" because ???
//		dont use "push" as we don't add numbers to an array, but add each value accumulating 		 to a the variable "total"
content_copyCOPY