# Extract Variable dialog

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/llms.txt).

> **TL;DR**
> `Refactor | Introduce Variable`
>
>
>
> [Introduce Variable… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "IntroduceVariable")
>
>
>
> The how to section: [Extract/Introduce variable](https://www.jetbrains.com/help/go/extract-variable.html.md)

Generally, this dialog is used to extract new variables. Depending on the language, there may be additional options.

| Item | Description | Language |
| --- | --- | --- |
| Name | Specify the name for the new variable. | All |
| Replace all occurrences | Select this option to replace all the occurrences of the selected expression (if more than one occurrence of the selected expression is found).  | All |
|  |    Choose how to extract the variable:        * var: declare a function-scoped variable, or a global variable outside a function.    * const: declare a block-scoped variable that cannot be reassigned.    * let: declare a block-scoped variable that can be reassigned.     ![JavaScript variable declaration](https://resources.jetbrains.com/help/img/idea/2026.3/js_variable_declaration.png)  | JavaScript |

## See also

### Procedures

### External Links

[https://blog.jetbrains.com/go/2018/10/26/refactorings-in-goland-extract-and-inline/](https://blog.jetbrains.com/go/2018/10/26/refactorings-in-goland-extract-and-inline/)

