How can I do string interpolation in JavaScript?

Since ES6, you can use template literals:

const age = 3
console.log(`I'm ${age} years old!`)

Expand snippet

P.S. Note the use of backticks: ``.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)