diff --git a/_posts/en/javascript/2017-06-15-looping-over-arrays.md b/_posts/en/javascript/2017-06-15-looping-over-arrays.md index 5519d1c7..16185120 100644 --- a/_posts/en/javascript/2017-06-15-looping-over-arrays.md +++ b/_posts/en/javascript/2017-06-15-looping-over-arrays.md @@ -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]); } ``` @@ -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)`. @@ -119,4 +119,4 @@ if (array.some(over_seven)) { } else { console.log('No element bigger than 7 was found'); } -``` \ No newline at end of file +```