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?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.