Merge pull request #1 from KamrulSh/my-fixes

fix for loop statement
pull/113/head
Kamrul Islam Shahin 5 years ago committed by GitHub
commit 0f5a7f94dc
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