| || |
How to extract a constant
To extract a constant
- In the editor, position the cursor inside the expression to be replaced with a constant.
- Choose on the main menu or on the context menu of the selection. Alternatively press Ctrl+Alt+C.
- If a constant can be extracted from several expressions in the current context, WebStorm shows all the relevant expressions in a pop-up list. Select the expression to apply the refactoring to.
- In the ExtractConstant dialog box, type the name of the new constant in the Name text box.
- Specify the scope to apply refactoring in:
- Click OK to start the refactoring.
Last modified: 10 August 2017