It's all in the title.
One part of my coding style is adding return
whenever a function with a callback parameter is called, e.g.:
(function() {
return whatever(function() /* callback */ { // Note the "return" keyword here
// ...
});
})();
For quite a while, I have been using the same construct for file scope function calls with a callback parameter, but I wonder if this can cause side-effects I am not aware of.
I could not find any documentation on the subject, and was unable to find out what it does.
Thanks!
[tl;dr] What does using the return
keyword mean at file scope and what does it do?