String Interpolation

noun

say it: “STRING in-ter-puh-LAY-shun” /strɪŋ ɪnˌtɜːrpəˈleɪʃən/

Putting a value straight into text by writing ${ } inside a backtick string, so `Total: ${total}` shows the total's value.

What is String Interpolation in JavaScript?

String Interpolation — Placing an expression inside ${} so its value becomes part of a template literal.

const item = "tea";
const message = `Order: ${item}`;

In a sentence

  • “With string interpolation, `Hi ${name}!` printed Hi Maya!”

Level: Novice · More JavaScript terms at this level

Updated

In other subjects