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.

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

What is “string interpolation”?

A

when you can embed variables and expressions in a string

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