fixed two typos in Day06 loops

pull/471/head
muazzam 3 years ago
parent 7782c525e0
commit c11def181d

@ -151,7 +151,7 @@ do {
### for of loop ### for of loop
We use for of loop for arrays. It is very hand way to iterate through an array if we are not interested in the index of each element in the array. We use for of loop for arrays. It is very handy way to iterate through an array if we are not interested in the index of each element in the array.
```js ```js
for (const element of arr) { for (const element of arr) {
@ -180,7 +180,7 @@ let sum = 0
for (const num of numbers) { for (const num of numbers) {
sum = sum + num sum = sum + num
// can be also shorten like this, sum += num // can be also shorten like this, sum += num
// after this we will use the shorter synthax(+=, -=, *=, /= etc) // after this we will use the shorter syntax(+=, -=, *=, /= etc)
} }
console.log(sum) // 15 console.log(sum) // 15

Loading…
Cancel
Save