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
The keyword for creating a constant is ______. | const | const | |
A constant can't be re-declared or _______. | reassigned | reassigned | |
If there's a possibility of reassignment, the keyword to use is ____ | let | let | |
Create a constant, players, and assign it 11. | const players = 11; | constplayers=11; | |
Create a string constant, name, assigning it your first name. Or make up the name. | const name = "Mark"; | constname=•.*•; | |
Create an integer constant. Make up the name and value. | const players = 11; | [a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*); | |
Define two integer constants on the same line. Make up the names of the contants and the integers. | const start = 0, stop = 1; | const[a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*),[a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*); | |
Declare a constant inside a function, assigning it a number. Code a statement that sends the value back to the calling code. Make everything up. | function sendNum() { const num = -10; return num; } |
function[a-z_$][a-zA-Z0-9_$]*\(\){[\r\n]const([a-z_$][a-zA-Z0-9_$]*)=[-]?(?:[.]\d+|\d+(?:[.]\d*)?);[\r\n]return\1;[\r\n]} | |
|
|||
|