search

Home  >  Q&A  >  body text

javascript - I see a sentence in Learning Functional Programming that I don’t understand

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

phpcn_u1582phpcn_u15822765 days ago448

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-19 10:12:17

    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.

    reply
    0
  • Cancelreply