0

The user will enter a string in JSON which I will read into a variable.

{"template":"I am ${age} years old and I am in grade ${grade}"}

I grab the value of template and place it into a variable called litTemplate.

var age = "6";
var grade = "1";

How do I get Javascript to treat litTemplate as a template literal filling in the values for age and grade?

Joseph U.
  • 4,457
  • 10
  • 41
  • 47

0 Answers0