From 2abc413a57d2ebe8fada5227fe70bd1ca50291c5 Mon Sep 17 00:00:00 2001 From: HereBeAndre Date: Wed, 27 Jul 2022 15:02:14 +0200 Subject: [PATCH 1/2] Add missing 'to' preposition --- manuscript/ch3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuscript/ch3.md b/manuscript/ch3.md index bcbf0b10..2789e0bc 100644 --- a/manuscript/ch3.md +++ b/manuscript/ch3.md @@ -377,7 +377,7 @@ function add(x,y) { } ``` -Now imagine we'd like take a list of numbers and add a certain number to each of them. We'll use the `map(..)` utility (see [Chapter 9, "Map"](ch9.md/#map)) built into JS arrays: +Now imagine we'd like to take a list of numbers and add a certain number to each of them. We'll use the `map(..)` utility (see [Chapter 9, "Map"](ch9.md/#map)) built into JS arrays: ```js [1,2,3,4,5].map( function adder(val){ From 0dadb6b606cfcf2d48b379b6ffeef944037ad688 Mon Sep 17 00:00:00 2001 From: HereBeAndre Date: Wed, 27 Jul 2022 15:02:57 +0200 Subject: [PATCH 2/2] Add missing var keyword in curiedSum ES6 arrow function snippet --- manuscript/ch3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manuscript/ch3.md b/manuscript/ch3.md index 2789e0bc..f3fb91ab 100644 --- a/manuscript/ch3.md +++ b/manuscript/ch3.md @@ -666,7 +666,7 @@ When trying to decipher curried functions, I've found it helps me tremendously i In fact, to reinforce that point, let's consider the same code but written with ES6 arrow functions: ```js -curriedSum = +var curriedSum = v1 => v2 => v3 => @@ -678,7 +678,7 @@ curriedSum = And now, all on one line: ```js -curriedSum = v1 => v2 => v3 => v4 => v5 => sum( v1, v2, v3, v4, v5 ); +var curriedSum = v1 => v2 => v3 => v4 => v5 => sum( v1, v2, v3, v4, v5 ); ``` Depending on your perspective, that form of visualizing the curried function may be more or less helpful to you. For me, it's a fair bit more obscured.