0

In VS Code for React project I try to show expressions, like that example - ${res.status} where status is variable, but instead of the variable itself a browser shows me a text ${res.status}. So it does not interpret the variable. Any ideas why it's happening?

enter image description here

  • 1
    Possible duplicate of [How can I do string interpolation in JavaScript?](https://stackoverflow.com/questions/1408289/how-can-i-do-string-interpolation-in-javascript) – Vencovsky Apr 26 '19 at 15:25

1 Answers1

0

Instead of using " use the back tick `

e.g.

"${res.status}" // wrong

`${res.status}` // correct
Vencovsky
  • 28,550
  • 17
  • 109
  • 176