June 2018
Beginner
288 pages
6h 31m
English
The fluency of single-line arrow functions truly shines in the functional style of programming. In this style of programming, we use function composition—a series of transformations—to make the code expressive and easier to maintain. Functional style code removes accidental complexity that’s present in the imperative style of programming.
Let’s explore this with a few examples. Suppose we’re given a list of names and asked to create a comma-separated result string with names of length five, all in uppercase. Try implementing that code using the traditional for loop. It’s a simple problem but not a simple solution—that’s accidental complexity. Here’s an imperative implementation:
| | const pickNamesInUpperCaseOfLength ... |
Read now
Unlock full access