Right here's my question how are the cool kids laying out their javascript these days? I've been looking around and from what I can tell everyone seems to be doing it different some people contain their functions inside object literals, some seem to just list there functions and have all there variable listed above. So what does eveyone think how should I be laying out my code.
var logsomestuff ="somestuff";
function logIt(){
console.log(logsomestuff);
}
or maybe
logIt = {
logsomestuff: "somestuff",
logIt: function(){
console.log(this.logsomestuff);
}
}
I don't know what do people think, best way to layout your js? above are just two example I'm sure there are a ton more. Thanks for anyhelp. I posted the same question of stack overflow but apparently it's better off here.