Looking for javascript Answers? Try Ask4KnowledgeBase
Looking for javascript Keywords? Try Ask4Keywords

JavaScriptTemplate Literals


Template literals are a type of string literal that allows values to be interpolated, and optionally the interpolation and construction behaviour to be controlled using a "tag" function.


  • message = `Welcome, ${user.name}!`
  • pattern = new RegExp(String.raw`Welcome, (\w+)!`);
  • query = SQL`INSERT INTO User (name) VALUES (${name})`


Template Literals were first specified by ECMAScript 6 §12.2.9.