Features WebStorm

JavaScript refactoring: Inline Variable

One of the major techniques to keep your code in a good shape is refactoring it. In the latest Web IDE EAP (#470) you can try the just added Inline Variable JavaScript refactoring.

Inline Variable — replaces local variable occurrences with its initializing expression.

Before

After

The Inline Variable refactoring, by the way, also works in the left part of local variable assignment.

During the inline process, Web IDE verifies if a variable can be safely replaced and gives a warning if not, e.g. there are its usages inside a functional expression.


More JS refactorings are coming in next builds.

Develop with pleasure!