From 89b9f92e5eb237724a5f026462a6b4f9601d003c Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 5 Feb 2020 09:48:22 +0200 Subject: [PATCH] Fix a typo --- blog_posts/javascript-for-in-for-of-foreach.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog_posts/javascript-for-in-for-of-foreach.md b/blog_posts/javascript-for-in-for-of-foreach.md index 9ac95c61d..f1a794f9c 100644 --- a/blog_posts/javascript-for-in-for-of-foreach.md +++ b/blog_posts/javascript-for-in-for-of-foreach.md @@ -41,7 +41,7 @@ for (let val of new Set(['a', 'b', 'a', 'd'])) console.log(val); // a, b, d (Set values) ``` -Finally, `forEach()` is a method of the `Array` prototype, which allowes you to iterate over the elements of an array. +Finally, `forEach()` is a method of the `Array` prototype, which allows you to iterate over the elements of an array. While `forEach()` only iterates over arrays, it can access both the value and the index of each element while iterating. ```js