Skip to content

Commit

Permalink
Merge pull request loverajoel#426 from akashbdj/master
Browse files Browse the repository at this point in the history
Fixes typos in looping-over-arrays post
  • Loading branch information
zenopopovici authored Sep 25, 2017
2 parents a177432 + f54b13a commit 14c02c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _posts/en/javascript/2017-06-15-looping-over-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ while (index < array.length) {

```javascript
const array = [1,2,3,4,5,6];
for (let index = 0; index < array.length, index++) {
for (let index = 0; index < array.length; index++) {
console.log(array[index]);
}
```
Expand All @@ -60,7 +60,7 @@ const array = [1,2,3,4,5,6];
const square = x => Math.pow(x, 2);
const squares = array.map(square);
console.log(`Original array: ${array}`);
console.log(`Squared array: ${array}`);
console.log(`Squared array: ${squares}`);
```

The full signature for `map` is `.map(current_value, index, array)`.
Expand Down Expand Up @@ -119,4 +119,4 @@ if (array.some(over_seven)) {
} else {
console.log('No element bigger than 7 was found');
}
```
```

0 comments on commit 14c02c9

Please sign in to comment.