Use backticks `
for template strings (not quotes '
or "
)
WHEN you write a string in backticks THEN it behaves just like a normal string
GIVEN variables wrapped in ${
and }
WHEN using ${x}
inside a template string THEN the value of x
is written out instead
WHEN using multiple variables THEN they get evaluated too
GIVEN expressions wrapped inside ${...}
WHEN wrapping an expression in ${...}
THEN they get evaluated
WHEN a function call is inside ${...}
THEN the result is rendered
Links
Description of template strings.
The specification describing the template string syntax.
Related Katas
Template strings
String API
string.includes()
string.repeat(count)
string.startsWith()
string.endsWith()
String.raw
string.trimStart()
string.matchAll()
Difficulty Level
BEGINNER
First Published
13 March 2015
Stats
5 tests to solve