12 ms·
There aren't native modules in JS (though they are coming in ES6). The module pattern is a way of having private scope by wrapping everything in a closure. So y
by natefaubion 13y ago
There aren't native modules in JS (though they are coming in ES6). The module pattern is a way of having private scope by wrapping everything in a closure. So yes, the module pattern just creates a closure and returns an object (or assigns to global scope) with its public members.