0

I'm using VSCODE 2017 and I'm having trouble with ES6 syntax.

I have a const called port declared, and I'm trying to use es6 literal templating to inject it in a string in the image below.

When the code is executed, the port variable is not being injected, nor has my IDE changed the colour of the ${port} syntax to blue, so it makes me believe it's not recognising the es6 syntax.

String Literal Not Detected

3141
  • 401
  • 1
  • 6
  • 23
Derek
  • 8,300
  • 12
  • 56
  • 88
  • It's not recognised as ES6 interpolation syntax because it is not ES6 template literal syntax :-) – Bergi Dec 30 '17 at 18:44

1 Answers1

3

You need to use backticks (`) not double quotes ("). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Priidik Vaikla
  • 744
  • 4
  • 13