Skip to content

Commit 0159cbe

Browse files
Merge pull request #129 from UmiKami/17-The-for-loop
fixed solution use for of
2 parents b51ba17 + bda99ed commit 0159cbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exercises/17-The-for-loop/solution.hide.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
let myArray = [2323, 4344, 2325, 324413, 21234, 24531, 2123, 42234, 544, 456, 345, 42, 5445, 23, 5656, 423];
22

33
let avg = 0;
4-
for (let i in myArray) {
5-
avg += myArray[i]
4+
for (let i of myArray) {
5+
avg += i
66
}
77
let avgTest = avg / myArray.length
88

0 commit comments

Comments
 (0)