Using Template Literals for String Interpolation in Javascript


Embed expressions within string literals.

Source Code

let name = "John";
let greeting = `Hello, ${name}!`;
console.log(greeting); // "Hello, John!"
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments