es6-template-literals Flashcards
1
Q
What is the syntax for writing a template literal?
A
var firstName = ‘anthony’
var lastName = ‘urbina’
var swag = Hi ${firstName} ${Urbina}!
variables/expressions go inside curly braces that follow a single question mark. the rest of the characters, including spaces, free-float and are interpreted as string values.
2
Q
What is “string interpolation”?
A
when you can embed variables and expressions in a string