Is the encapsulation method of JS the way require.js is written?

Is the parameter mapu cesium $in

clipboard.png
function an introduced dependency?

what do the three parameters in parentheses mean by the exported interface after that?

Jul.13,2022

this is an anonymous function self-tuning

The formal parameter mapu cesium $of the

function corresponds to the argument MapUtils cesium jQuery


(function () {}) (); is the function that IIFE executes immediately, and the main use here is encapsulation: distinguishing internal and external contexts, protecting variables from mixing, and so on.
IIFE is one of the ancient js modularization methods, as you said, "the parameter mapu cesium $in function is a dependency that internal functions need to introduce," followed by the actual parameters of the input.


require.js is written at the beginning of define. Require.js is something that dates back many years.

Menu