pull/471/merge
Muazzam 3 years ago committed by GitHub
commit 0ece5ccbc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,7 +151,7 @@ do {
### 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
for (const element of arr) {
@ -180,7 +180,7 @@ let sum = 0
for (const num of numbers) {
sum = 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

Loading…
Cancel
Save