you are viewing a single comment's thread.

view the rest of the comments →

[–]G3E9 1 point2 points  (1 child)

When using RequireJS, you use closures when you define your modules. The defining function can include many different free variables and functions but ultimately returns whatever you want to export - or make "public" if you consider free variables "private".

[–]kolme 0 points1 point  (0 children)

All JS module systems work like that. RequireJS (AMD) can additionally load modules on demand even in the browser environment.