WebMasterCampus
WEB DEVELOPER Resources

Javascript ES6 Template Literals

Learn Javascript ES6 Template Literals


ES6 Template Literals

In ES6, you create a template lieteral by wrapping your text in backticks (`) as follows. Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them.

ES6 Template Literals Example


let expression = "embeded here";

console.log(`string message`);

console.log(`string message line 1
 string message line 2`);

console.log(`string message ${expression} as string text`);

image.png

Created with love and passion.