Update MDN docs link for tagged templates
This commit is contained in:
parent
ef370b6ace
commit
01c531b375
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ let guestList = "Guests: // Error: Unexpected token ILLEGAL
|
||||||
|
|
||||||
Single and double quotes come from ancient times of language creation when the need for multiline strings was not taken into account. Backticks appeared much later and thus are more versatile.
|
Single and double quotes come from ancient times of language creation when the need for multiline strings was not taken into account. Backticks appeared much later and thus are more versatile.
|
||||||
|
|
||||||
Backticks also allow us to specify a "template function" before the first backtick. The syntax is: <code>func`string`</code>. The function `func` is called automatically, receives the string and embedded expressions and can process them. You can read more about it in the [docs](mdn:/JavaScript/Reference/Template_literals#Tagged_template_literals). This is called "tagged templates". This feature makes it easier to wrap strings into custom templating or other functionality, but it is rarely used.
|
Backticks also allow us to specify a "template function" before the first backtick. The syntax is: <code>func`string`</code>. The function `func` is called automatically, receives the string and embedded expressions and can process them. You can read more about it in the [docs](mdn:/JavaScript/Reference/Template_literals#Tagged_templates). This is called "tagged templates". This feature makes it easier to wrap strings into custom templating or other functionality, but it is rarely used.
|
||||||
|
|
||||||
## Special characters
|
## Special characters
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue