Skip to content

Commit 7f9241c

Browse files
jameshbushljharb
authored andcommittedJun 24, 2019
Fixes arrow function arguments description (#75)
* Fixes description of arrow function arguments * Update ch02.asciidoc Co-Authored-By: Jordan Harband <ljharb@gmail.com>
1 parent b1a1622 commit 7f9241c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎ch02.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function puzzle() {
286286
puzzle('a', 'b', 'c')(1, 2, 3)
287287
----
288288

289-
In this case, the `arguments` object refers to the context of the `puzzle` function, because arrow functions don't create a closure. For this reason, the printed arguments will be `'a', 'b', 'c'`.
289+
Because arrow functions don't have their own `arguments` keyword (or `this` or `super`), the lookup bubbles up to the outer scope of the `puzzle` function. That means the printed arguments will be `'a', 'b', 'c'`.
290290

291291
I've mentioned there are several flavors of arrow functions, but so far we've only looked at their fully fleshed version. What are the other ways to represent an ((("arrow functions", "lexical scoping", startref="af2ls")))((("lexical scoping", startref="ls2")))arrow function?
292292

0 commit comments

Comments
 (0)
Please sign in to comment.