1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
Type the character used in a template literal to enclose a string. | ` | ` | |
Assign a string to a variable using a template literal. Make up the variable name and the string. | let text = `Hello World!`; | let[a-z_$][a-zA-Z0-9_$]*=`.*`; | |
Rewrite this statement using a template literal. | let aName = 'Alex "the Hammer" Brown'; | let aName = `Alex "the Hammer" Brown`; | letaName=`Alex•theHammer•Brown`; |
Rewrite this statement using a template literal. | let greeting = "Hi, " + username; | let greeting = `Hi, ${username}`; | letgreeting=`Hi,\${username}`; |
Code an alert using a template literal that contains double quotation marks inside the string. Make up the string. | alert(`Call me "Marco"`); | alert\(`.*•.*•.*\); | |
Rewrite this statement using a template literal. | let text = "Hello " + "World!"; | let text = `Hello World!`; | lettext=`HelloWorld!`; |
Rewrite this statement using a template literal. | let text = "The total is " + total; | let text = `The total is ${total}`; | lettext=`Thetotalis\${total}`; |
Use a template literal to combine a string with the expression 2 * 3 . Put the string first. Assign the combination to a variable. Make up the name of the variable and the string. | let text = `Product: ${2 * 3}`; | let[a-z_$][a-zA-Z0-9_$]*=`.*\${2\*3}`; | |
|
|||
|