user7858768
user7858768

Reputation: 1026

InteliJ & javascript: is it possible for 'introduce variable' to be 'introduce const' instead?

When we are inside awesome InteliJ in JavaScript and use Alt+Enter shortcut on some expression:

Lets say

cli.cliArgs();

We get a prompt such as Introduce local variable automating the creation of the following variable:

let cliArgs = cli.cliArgs();

Is it possible to have InteliJ introduce a 'const' value instead of variable values:

const cliArgs = cli.cliArgs();

Upvotes: 0

Views: 132

Answers (1)

lena
lena

Reputation: 93868

You can normally choose between let, const and var when introducing variable, and your choice is remembered (checked in 2020.1.4):

enter image description here

Upvotes: 1

Related Questions