Forum Moderators: open
In both cases you've created a function named blah.
Which style to use is:
1)A matter of personal preference (You say tomayto, I say tomahto.)
2) The context within which the function is being declared could, possibly, play a part. For example, if you're declaring the function inside another function, it might feel more right to declare it as part of a larger sequence of variable declarations, as is the case with the function bar in the following:
function foo(){
var d=document,dE=d.documentElement,bar=function(e){return [e.clientWidth,e.clientHeight]};
alert('Viewport width is: '+bar(dE)[0]);
};
Bottom line advice: Whatever is clearer to your brain, do it that way.
It's only syntax, no functional difference.