links: YDK JS Chapter 2


In computer programming, string interpolation (or variable interpolation, variable substitution, or variable expansion) is the process of evaluating the string literal, containing one or more place holders, yielding a result in which placeholders are replaced with their corresponding values

An alternative to string interpolation is string concatenation

Examples:

let age = 26
console.log(`my age is ${age}`)
// my age is 26
// ${age} is placeholder
// backticks are delimiters
// dart
var age = 26
print('my age is $age')
// my age is 26
// $age is placeholder

tags: fundamentals

source