Update 06_day_loops.md

Wrong plus
pull/182/head
AmrGablla 4 years ago committed by GitHub
parent 07143be3b7
commit ee2cd8bd7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,7 +178,7 @@ for (const num of numbers) {
// adding all the numbers in the array
let sum = 0
for (const num of numbers) {
sum += sum + num // can be also shorten like this, sum += num
sum = sum + num // can be also shorten like this, sum += num
}
console.log(sum) // 15

Loading…
Cancel
Save