P.S. Const !== Immutable
Immediate Invoked Functional Expression
A Format For Writing Modular JavaScript In The Browser
Module Definition
define('myModule',
['foo', 'bar'],
function ( foo, bar ) {
var myModule = {
doStuff: function(){
console.log('Call me maybe!');
}
}
return myModule;
});
Module Using
require(['app/myModule'],
function( myModule ) {
var module = new myModule();
module.doStuff();
});
A Module Format Optimized For The Server
Modules Of The Future