Say I have a variable str
var str = "123"
Now I could do console.log(`Hello ${str}`)
and it will print Hello 123
Now I have another variable strnew
var strnew = 'Hello ${str}'
Note (based on answers/comments) - strnew
is read from a file, so its always a string and cant be replaced with `
How do I console.log(...)
to print Hello 123
Is it possible wihtout any kind of eval()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…