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
A function without a name is an ________ function. | anonymous | anonymous | |
Fill in the blank to code the first line of this anonymous function. | ________________ alert("Hello, World!"); } |
function() { | function\(\){ |
Code an anonymous function that returns the integer 12. | function() { return 12; } |
function\(\){[\r\n]return12;[\r\n]} | |
In the following code, x is a ________. | const x = function() { | variable | variable |
Code the first line of an anonymous function assigned to a variable. Make up the variable name. Remember to use the preferred keyword, const. | const anonFunc = function() { | const[a-z_$][a-zA-Z0-9_$]*=function\(\){ | |
Call an anonymous function using a variable. Make up the name of the variable. | anonFunc(); | [a-z_$][a-zA-Z0-9_$]*\(\); | |
A self-invoking anonymous function begins with an opening parenthesis, like this. Fill in the blank with 4 characters to complete it. | (function() { alert("Hello, World!"); }____ |
) (); | \)\(\); |
Code a self-invoking function that displays an alert. Make up the alert string. | (function() { alert("Hi"); })(); |
\(function\(\){[\r\n]alert\(•.*•\);[\r\n]}\)\(\); | |
|
|||
|