let name = "Ali"
const a = 'hi ${name}';
console.log.(a);
it works on online compiler but does not work while I am writing in vs code. it show output as '->hi ${name}' though I want the dynamic output like hi Ali.
let name = "Ali"
const a = 'hi ${name}';
console.log.(a);
it works on online compiler but does not work while I am writing in vs code. it show output as '->hi ${name}' though I want the dynamic output like hi Ali.
You need to use a template string: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
You need to be using a backtick (`), not a quotation (')