
8 Code Assists for Functions and Methods
Functions and methods are essential building blocks of any non-trivial program. The following code actions make it easier to work with functions, methods, and their parameters:
- Add {…} to arrow function
Convert arrow function expression body into a block body.
- Convert function to arrow function
Replace function expressions with arrow functions, a more concise syntax.
- Convert function to object method
Convert property assignments with functions to method declarations.
- Convert named function declaration to variable declaration
Converts a named function to a const declaration with a function expression.
- Move default value into parameter
Replace default value assignment expressions with default parameter values.
- 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.
- Remove {…} from arrow function
Convert an arrow function block body into an expression body.
- Remove IIFE/IIAF
Remove immediately-invoked function expressions (IIFEs) and immediately-invoked arrow functions (IIAFs) without parameters.