官术网_书友最值得收藏!

Starting Out with Functions - A Core Concept

In chapter 2Thinking Functionally - A First Example, we went over an example of FP thinking, but let's now go to the basics, and review functions. In Chapter 1, Becoming Functional - Several Questions, we mentioned that two important JS features were functions as first-class objects and closures. Now, in this chapter, let's:

  • Examine some key ways of defining functions in JS
  • Go in detail regarding arrow functions, which are closest to the lambda calculus functions
  • Introduce the concept of currying
  • Revisit the concept of functions as first-class objects

We'll also consider several FP techniques, such as:

  • Injection, as needed for sorting with different strategies and other uses
  • Callbacks and promises, introducing the continuation passing style
  • Polyfilling and stubbing
  • Immediate invocation schemes
主站蜘蛛池模板: 临高县| 瑞丽市| 静海县| 梨树县| 大竹县| 山阴县| 重庆市| 乳源| 吉隆县| 林西县| 吉水县| 宁明县| 闽侯县| 沐川县| 黑水县| 黄龙县| 永胜县| 元谋县| 六枝特区| 博乐市| 宽城| 杭锦旗| 石家庄市| 锡林浩特市| 嵊州市| 大田县| 德庆县| 景泰县| 景泰县| 上栗县| 台东市| 宁乡县| 石狮市| 仁寿县| 融水| 奉新县| 轮台县| 金坛市| 青川县| 托里县| 驻马店市|