You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doesn't really buy you much when you only have one function, but after about 3 or 4 it makes it a lot easier to know what the module's api is without having to scroll at all.
Function declarations also improve your stack trace because the function has a name whereas a function expression is nameless unless you explicitly give it one, which people rarely do.
These are my opinions though, curious to hear @felixge weigh in.
The guide already has a bunch of examples on how functions should be declared, but they are given in the context of other rules. I wouldn't mind an explicit section for this.
How about function declarations? It drives me nuts when I see
var packAssets;
packAssets = function(...) {
return packed;
}
I don't understand why people do this. If you call it before the declaration packAssets will be undefined.
The text was updated successfully, but these errors were encountered: