An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.
(c) MDN
🐊Putout plugin adds ability to find and remove IIFE. Check out in 🐊Putout Editor:
- ✅ getting read of
IIFE
using Linked Template Values(__a
); - ✅ getting read of
IIFE
using Linked Args (__args__a
);
npm i @putout/plugin-remove-iife
{
"rules": {
"remove-iife": "on"
}
}
(function() {
console.log('hello');
})();
((a) => fn(a))(value);
((a, b) => fn(a, b))(value, value2);
console.log('hello');
fn(value);
fn(value, value2);
MIT