0

I tried using ${} instead of the normal concatenation in JavaScript to make sentences after storing variables but it isn't running.

var firstName = "David";
var surname = "Israel";

console.log("My name is ${firstName} and my surname is ${surname}")

1 Answers1

1

Try

var surname = "Israel";

console.log(`My name is ${firstName} and my surname is ${surname}`)
casualhuman
  • 163
  • 14