Skip to content

Commit

Permalink
Fixes some typos in looping-over-arrays post
Browse files Browse the repository at this point in the history
  • Loading branch information
akashbdj committed Sep 19, 2017
1 parent a177432 commit f54b13a
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 f54b13a

Please sign in to comment.