Template Strings

template strings are string literals that allow for embedded expressions. and yes, you can use multi-line strings and string interpolation features with them, such as:


  <h1 y="ab${1+2}cd">hello ${title}!</h1>
  ${wow.map(function (w) {
    return hx `<b>${w}</b>\n`


template strings are enclosed by back-tick characters instead of double/single quotes and can contain placeholders, which are indicated by (${some expression}).

the expressions in the placeholders and the test between them get passed to a function (default Fn concatenates the parts into a single string.

if there is an expression preceding the template string (tag here), the template string is called "tagged template string"