Home > Back-end >  String interpolation (String formatting/template literal) doesn't work in .js files
String interpolation (String formatting/template literal) doesn't work in .js files

Time:11-05

I can't make backticks to enable string interpolation in any .js file in Visual Studio code. They work fine in .vue files, however.

The following line gets evaluated as a "dumb" string:

`$(name.value) is your name`

Is there a setting to add/remove for VS.Code to make string interpolation work?

CodePudding user response:

Change to this.

`${name.value} is your name`
  • Related