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?
Asked
Active
Viewed 37 times
0
-
1Possible 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 Answers
0
Instead of using "
use the back tick `
e.g.
"${res.status}" // wrong
`${res.status}` // correct

Vencovsky
- 28,550
- 17
- 109
- 176
-
@GlebKrylov In the photo you just posted, you are using a single quote, not a back-tick. – seanulus Apr 26 '19 at 16:28
-