5

I am trying to use string interpolation so that, given

var eruption1 = 112;

I can use

console.log("Eruption 1: {eruption1}");

instead of

console.log('Eruption 1: '+ eruption1);

However when I use either

console.log("Eruption 1: {eruption1}");

or

console.log('Eruption 1: {eruption1}');

I just get

Eruption 1: {eruption1}

instead of

Eruption 1: 112

How can I use string interpolation in javascript?

thefourtheye
  • 221,210
  • 51
  • 432
  • 478
Michael Durrant
  • 89,394
  • 88
  • 305
  • 468

0 Answers0