What is modularity? What is the difference between jQuery plug-in and componentization?

  node.js, question

I don’t know what modularity is all the time. I learned a little about node, and I also used module.exports and require in it. my own understanding is to package different functions into different modules and call them when using them. is jquery plug-in modular? Modular is What? again Js modularity requires What? What knowledge does modularization need to learn?

If you just don’t know “what is modularity”, then think of Lego, a pile of small parts that can be assembled into various “planes”, “tanks” and “ships”. Among them, each small part is modularized, and it is because of modularity that Lego has become so fun and changeable.

The component is a slightly higher level of abstraction, for example, a pile of “wings” is made up of several small parts, so when a small partner also wants to assemble a “plane”, he does not need to spell the “wings” from scratch, and just take the “wings” I have spelled out. The “wings” here are modular.

Broadly speaking,jqueryThe plug-in is modular (logical can also be called a component), we are usually not so keen to sayjqueryIs modular, because we usually speak of modularity, is actually some general specification description standard, such as:AMD,CommonJS,ES2015