Which is the common best practice for where to place parenthesis after a function? I see at times function ()
and I see function()
. With parameters I see function (param)
and then I see function(param
. Is this just a matter of preference or is there a reason as to why there would be whitespace after the function or there would not be whitespace?
JavaScript is not white space sensitive.you define your coding style.
Though having white space between the function and parenthesis is no sin. If you follow crockford's javascript standards. He advises not to have space in between.