preface

Preliminary review

How to Write JS well

Procedural abstraction

  • Methods used to handle local detail control

  • Basic application of functional programming ideas

example

Operation limit

  • Some asynchronous interactions

  • Secondary HTTP request

Once

  • To enable the “once” requirement to cover different event handling, we can separate this requirement out. This process is calledProcedural abstraction.

Higher-order functions

  • Take functions as arguments

  • Take a function as the return value

  • Often used as a function decorator

Higher-order functions are commonly used

  • Once

  • You’re Throttle.

  • Debounce (Anti-shock function)

  • Consumer/2 (Asynchronous consumption)

  • Iterative functions are iterative.

Thinking and discussing

Why use higher-order functions?

Programming paradigm

Imperative and declarative

example

  • Toggle – imperative

  • Toggle – declarative

  • Toggle – three states

conclusion

  • Process abstraction/HOF/decorator

  • Imperative/declarative

  • If there is any mistake above, please point out in the comment section, thank you!

After reading it, give it a thumbs-up and then walk away