Recently started writing modularised js and I'm starting to notice the numerous ways one can write them.
I know the core principles of when to use an object literal or function but whats the beneficiaries of writing a module as an object literal or function on a larger scale development? Portability, flexibilty, maintainability?
var filterOverlays = { ..code .. };
var filterOverlays = function() { ..code ..}
Call in another page:
$(document).ready(filterOverlays.init);
filterOverlays();