I'm writing a new web application, I haven't got problem with backend part (it's my job until 6years) but i'm little new with frontend development (around 1 year). What's the best way to manage your JS code?
At this time I use a single file (app.js) where i call many function like this:
writer.init();
other.init();
writer and other are functions like this
function () {
var writer = {
"init": function() {
// do something
}
}
}()
I think it's an ugly way. What are the best practices?