|
|
|
|
|
by njonsson
5289 days ago
|
|
All decent suggestions. I quibble with this, though: // Don't do this:
function getData() { }
// Do this instead:
var getData = function() { };
The assignment is righteous, but by omitting the function’s name, you make stack traces more difficult to follow. Better this instead: var getData = function getData() { };
|
|
What's the benefit of var x = function x(){}? Is it just illustration that functions can be assigned to variables?