5
I learned three ways to write Self Invoking Functions, Immediately-Invoked Function Expression (IIFE), and I was left with a doubt whether beyond the syntax there is any difference between them.
(function () {
console.log("Olá");
})();
(function () {
console.log("Olá");
}());
! function () {
console.log("Olá");
}();
void function () {
console.log("Olá");
}();
OBS. The question refers to the Self Invoking Functions and not the difference for "normal functions".
See also: What is the usefulness of Exclamation Mark (!) before declaring functions in Javascript?
– bfavaretto