Design Patterns used in the jQuery library

后端 未结 4 1999
臣服心动
臣服心动 2020-12-07 07:10

jQuery is highly focused on the DOM and provides a nice abstraction around it. In doing so, it makes use of various well known design patterns which just hit me yesterday. O

4条回答
  •  半阙折子戏
    2020-12-07 07:22

    In the eyes of functional programming, jQuery is a Monad. A Monad is a structure that passes an object to an action, returns the modified object and passes it on to the next action. Like an assembly line.

    The Wikipedia article covers the definition very well.

提交回复
热议问题