JavaScript-Functional programming

Source: Internet
Author: User
Tags call back closure

Chapter 1th Introduction to JavaScript Functional programming 1
1.1 JavaScript Case 1
1.2 Starting Functional Programming 4
1.2.1 Why functional programming is important 4
1.2.2 The function as an abstract unit 7
1.2.3 Package and Hide 9
1.2.4 function as a unit of behavior 10
1.2.5 Data Abstraction 14
1.2.6 Functional JavaScript Preliminary 17
1.2.7 Acceleration 19
1.3 Underscore example 22
1.4 Summary 23
2nd-class function and applicative programming 24
2.1 function is a one-class citizen 24
2.2 Applicative Programming 30
2.2.1 Assembly Center Programming 31
2.2.2 Other examples of applicative programming 32
2.2.3 define several applicative functions 35
2.3 Data Thinking 36
2.4 Summary 43
Chapter 3rd scope and closure of variables 44
3.1 Global Scope 44
3.2 Lexical Scope 46
3.3 Dynamic Scope 47
3.4 Function Scope 51
3.5 Closure Pack 52
3.5.1 Simulation Closure 53
3.5.2 using closures 57
3.5.3 Closure Abstraction 59
3.6 Summary 60
4th High-Order function 62
4.1 Functions with other functions as arguments 62
4.1.1 Thinking about transfer functions: max, Finder, and best 63
4.1.2 more thinking about transfer functions: repetition, recurrence, and conditional iterations
(Iterateuntil) 65
4.2 Functions that return other functions 67
4.2.1 High-order function capture parameter 69
4.2.2 Benefits of capturing variables 69
4.2.3 prevent non-existent functions: Fnull 72
4.3 Integration: Object Verifier 74
4.4 Summary 77
The 5th chapter is the function building function 78
5.1 The essence of the functional combination 78
5.2 Curry (currying) 83
5.2.1 to the right, or to the left 84
5.2.2 Automatic Curry parameter 85
5.2.3 Curry Fluent API 88
5.2.4 JavaScript Curry Disadvantage 89
5.3 Parts Application 89
The 5.3.1 section applies one and two known parameters 91
5.3.2 section applies any number of parameters 92
5.3.3 Local Application Combat: Pre-condition 93
5.4 By combining end-to-end splicing functions 96
5.5 Summary 98
6th Chapter Recursion 100
6.1 Self-absorption (self-absorbed) function (call own function) 100
6.1.1 using recursive traversal diagram 105
6.1.2 Depth-first self-recursive search 106
6.1.3 Recursive and combinatorial functions: Conjoin and Disjoin 108
6.2 Mutual correlation function (function calls other functions that call back to it) 110
6.2.1 using recursive deep cloning 111
6.2.2 iterating through nested arrays 112
6.3 Too many recursion 114
6.3.1 Generator 117
6.3.2 Trampoline principle and callback 120
6.4 Recursion is a bottom-level operation 121
6.5 Summary 122
7th. Purity, invariance and change policy 123
7.1 Purity 123
7.1.1 the relationship between purity and testing 124
7.1.2 Extracting pure Function 125
7.1.3 testing the properties of an impure function 126
Relationship between purity of 7.1.4 and citation transparency 127
7.1.5 Purity and idempotent 129
7.2 invariance 130
7.2.1 If a tree fell in the woods, was there a sound? 132
7.2.2 invariance and recursion 133
7.2.3 Freezing and cloning 134
7.2.4 observing invariance at the function level 136
Invariance of 7.2.5 Observation Object 137
The 7.2.6 object is often a low-level operation 140
7.3 Policy for controlling change 141
7.4 Summary 144
8th Stream-based programming 145
8.1 Links 145
8.1.1 Inert Chain 148
8.1.2 Promises 152
8.2 Pipe 154
8.3 Data flow and control flow 158
8.3.1, find a normal shape. 161
The 8.3.2 function simplifies the creation of action 164
8.4 Summary 166
9th. No class Programming 167
9.1 Data-driven 167
9.2 Mixins 173
9.2.1 Modifying the core prototype 175
9.2.2 Class Hierarchy 176
9.2.3 Changing hierarchies 179
9.2.4 flattening hierarchy of Mixin 180
9.2.5 extending the new semantics through Mixin 185
9.2.6 the new type by mixin mixing 187
The 9.2.7 method is a low-level operation 188
9.3}). Call ("Finis"); 190
Appendix A more functional JavaScript 191
A.1 JavaScript-Functional Library 191
a.1.1-Functional JavaScript 191
a.1.2 Underscore-contrib 192
a.1.3 RxJS 192
a.1.4 bilby 194
a.1.5 allong.es 195
a.1.6 Other functional Libraries 196
A.2 functional language that can be compiled into JavaScript 196
a.2.1 Clojurescript 196
a.2.2 Coffeescript 197
a.2.3 Roy 198
a.2.4 ELM 198

JavaScript-Functional programming

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.