I'm a newbie to JavaScript and recently pick up a project with many JavaScript files. Previous guy on this job seemed get all the way down using a lot of global variables rather than any design pattern.
It is hard for maintaining as referring global variables everywhere. and can see private info in console by directly typing global variable names.
So my question is how should I do in further development? I would much like my future code more organized and modularized.
I read about there is no module definition in JavaScript and I can
Using
module pattern
orRevealing module pattern
Using
Requirejs
/commonjs
/webpack
maybe?
I don't know, After reading about docs, I'm still confused that does it make much difference if I use module pattern
by myself or introducting another requirejs
? They all seem to be able to get my code modularized.