JavaScript Asynchronous Programming with JavaScript Understanding Promises Handle Multiple Promises with Promise.all

$ { } I'm a little confused by this.

I know this was used with template literals and used for dynamic values but its not clicking in plain English to me. Please help.

1 Answer

Steven Parker
Steven Parker
207,003 Points

In a template literal, an expression surrounded with "${" and "}" will be replaced by it's value. For example:

var name = "Joe";
var food = "cookies";
console.log(`My name is ${name} and I like ${food}.`);
// the above should log: "My name is Joe and I like cookies."

This replacement process is called "interpolation".