JS-ES6 Flashcards

1
Q

What is the syntax in writing a template literal?

A

Enclosed by backpacks(`) and and can contain placeholders indicated by the dollar sign and curly braces(e.g. ${expression}). The expressions in the placeholders and the text between the backpacks get passed to a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is template literals?

A

Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is string interpolation?

A

If you put a dynamically computed value inside a ${ }, it is converted to a string and inserted into the string returned by the literal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly