You-Dont-Know-JS icon indicating copy to clipboard operation
You-Dont-Know-JS copied to clipboard

Chapter 2: Functions, Confusing Grammar

Open brandedcow opened this issue 5 years ago • 3 comments

Last sentence in the 7th paragraph is phrased in a confusing way:

Not all languages treat functions as values, but it's essential for a language to support the functional programming pattern, as JS does.

Some suggested alternatives:

  • Not all languages treat functions as values, but it's essential for a language that supports the functional programming pattern, as JS does.
  • Not all languages treat functions as values, but it is essential for languages that support the functional programming pattern, like JS.

Edition: 2nd

Book Title: YDKJSY

Chapter: 2

Section Title: Functions

Problem: Grammar

brandedcow avatar Sep 19 '20 21:09 brandedcow

If it read "Not all languages treat functions as values, but that's essential..." would it read clearer to you?

getify avatar Sep 19 '20 22:09 getify

Yea, that would work, something like:

Not all languages treat functions as values, but that's essential to support the functional programming pattern, as JS does.

brandedcow avatar Sep 20 '20 03:09 brandedcow

OK, it's a minor nit, which I don't typically indulge (especially after a book has been published for almost 9 months). But I can see where there's a little confusion, so I will keep this issue open for if/when I do a future errata update.

getify avatar Sep 20 '20 14:09 getify