From 896eeb4d2f1cfc1eeb50772b70ed06aa8f2af9c4 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Tue, 12 Jul 2016 15:09:04 -0400 Subject: [PATCH] Add missing word This PR adds a missing "how" to the description of the iteration helpers' behavior. "Each of these helpers accepts a function callback to apply to each element in the array, differing only in *how* they respectively respond to a return value from the callback." --- this & object prototypes/ch3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/this & object prototypes/ch3.md b/this & object prototypes/ch3.md index e74b4117f..937f61f1f 100644 --- a/this & object prototypes/ch3.md +++ b/this & object prototypes/ch3.md @@ -813,7 +813,7 @@ for (var i = 0; i < myArray.length; i++) { This isn't iterating over the values, though, but iterating over the indices, where you then use the index to reference the value, as `myArray[i]`. -ES5 also added several iteration helpers for arrays, including `forEach(..)`, `every(..)`, and `some(..)`. Each of these helpers accepts a function callback to apply to each element in the array, differing only in they respectively respond to a return value from the callback. +ES5 also added several iteration helpers for arrays, including `forEach(..)`, `every(..)`, and `some(..)`. Each of these helpers accepts a function callback to apply to each element in the array, differing only in how they respectively respond to a return value from the callback. `forEach(..)` will iterate over all values in the array, and ignores any callback return values. `every(..)` keeps going until the end *or* the callback returns a `false` (or "falsy") value, whereas `some(..)` keeps going until the end *or* the callback returns a `true` (or "truthy") value.