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.
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.
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.