Skip to content

Tag: ES6

Template literals

Template literals in ES6 allows us to embed expressions to our string literals. We can use multi-line strings and string interpolation features with them. Template literals are enclosed by the back-tick (` `) instead of double or single quotes. var message = `single line string`; console.log(message); // single line string   We can include place holders for string substitution using ${ } syntax var expression = “place holder”; // string substitution console.log(`this is a text with ${expression} in a line`); // this is a text with place holder in a line… Read more Template literals