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
Any name that is legal for a _________ is legal for a function. | variable | variable | |
This is the first line of the function code. Write the statement that calls the function. | function doSomething() { | doSomething(); | doSomething\(\); |
Code the first line of a function displayAlert() | function displayAlert() { | functiondisplayAlert\(\){ | |
Code a function named askName() that prompts the user to "Enter name" and assigns the answer to userName, which hasn't been declared beforehand. | function askName() { let userName = prompt("Enter name"); } |
functionaskName\(\){[\r\n]letuserName=prompt\(•Entername•\);[\r\n]} | |
Code the first line of a function. Make up the name of the function. | function findsPrice() { | function[a-z_$][a-zA-Z0-9_$]*\(\){ | |
Code a function that displays an alert with your first name as the message. Make up the name of the function. | function say() { alert("Mark"); } |
function[a-z_$][a-zA-Z0-9_$]*\(\){[\r\n]alert\(•.*•\);[\r\n]} | |
Code a function that converts string1 to all-uppercase and assigns it to string2. Make up the name of the function. | function capIt() { let string2 = string1.toUpperCase(); } |
function[a-z_$][a-zA-Z0-9_$]*\(\){[\r\n]letstring2=string1\.toUpperCase\(\);[\r\n]} | |
Code a function that calls another function. Make up the names of the functions. | function func1() { func2(); } |
function[a-z_$][a-zA-Z0-9_$]*\(\){[\r\n][a-z_$][a-zA-Z0-9_$]*\(\);[\r\n]} | |
|
|||
|