Hacker News new | ask | show | jobs
by natefaubion 4763 days 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.