Tagged template strings, are an advanced form of template strings
Syntax: prefix a template string with a function to call (without "()" around it)
the tag function can access each part of the template
the 1st parameter receives only the pure strings of the template string
the strings are an array
expressions are NOT passed to it
the 2nd and following parameters contain the values of the processed substitution
the 2nd parameter contains the first expression`s value
the 3rd parameter contains the second expression`s value
using ES6 rest syntax, all values can be accessed via one variable
Links
Description of tagged template strings.
Required Knowledge
- basics (Template strings)
- as parameter (Rest operator)
Related Katas
Template strings
- basics
- multiline
- tagged template strings
raw
property
String API
string.includes()
string.repeat(count)
string.startsWith()
string.endsWith()
String.raw
string.trimStart()
string.matchAll()
Difficulty Level
INTERMEDIATE
First Published
17 March 2015
Stats
6 tests to solve