Fix(06_Days_Loop): expression error

There is a mistake in 'for of loop' section:
pull/222/head
Tianyu Yuan 4 years ago committed by GitHub
parent 07143be3b7
commit 54b438fca2
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 // adding all the numbers in the array
let sum = 0 let sum = 0
for (const num of numbers) { 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 console.log(sum) // 15

Loading…
Cancel
Save