javascript - I see a sentence in Learning Functional Programming that I don't understand
phpcn_u15822017-05-19 10:10:17
0
1
444
JavaScript is such a dynamic language with lots of shared state, it isn't long before we accumulate enough complexity to make our code unwieldy and hard to maintain. What do many shared states mean? I can't understand, please. Great guidance
An important feature of functional programming is that the input is not affected by the process. After a function is executed, the previous input remains unchanged, while the non-functional part of ES will have many implementations that will change the input. At this time Changes in the input can be understood as changes in shared states, and if it is pure FP style, then it is a new state, that is, a new output is generated, rather than a so-called shared state change.
An important feature of functional programming is that the input is not affected by the process. After a function is executed, the previous input remains unchanged, while the non-functional part of ES will have many implementations that will change the input. At this time Changes in the input can be understood as changes in shared states, and if it is pure FP style, then it is a new state, that is, a new output is generated, rather than a so-called shared state change.