I commonly see both conventions and I'm wondering if there's an actual difference.
(function () {
document.write("it works");
}());
(function () {
document.write("it also works");
})();
I commonly see both conventions and I'm wondering if there's an actual difference.
(function () {
document.write("it works");
}());
(function () {
document.write("it also works");
})();
There no difference between the two , The opening brace serves as a syntactic hint to tell the parser that what follows is a function expression instead of a function declaration.