Push parameter into IIFE/IIAF

Push a parameter of an immediately-invoked function expressions (IIFEs) or an immediately-invoked arrow functions (IIAFs) into the function body.

Refactoring
ES2015
P42 for VS Code
P42 for GitHub
Push parameter into IIFE/IIAF

Why is this refactoring helpful?

With the introduction of let and const in ES6, passing parameters into IIFEs as become unnecessary in many cases. Pushing the parameters into the IIFE can simplify the code and unlock the removal of the IIFE.

Configuration

Related Code Assists

Learn More

Available In