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
  • 233,700
  • 52
  • 457
  • 497
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

0 Answers0