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
You can use a function anywhere you'd use a _______. | variable | variable | |
Call the function x() that calls the function y(). | x(y()); | x\(y\(\)\); | |
Fill in the blank to return a number rounded by the function roundNum(). | function addNums(num1, num2) { let tot = num1 + num2; return __________;br} |
roundNum(tot); | roundNum\(tot\); |
Code a function that does nothing but call another function. Make up all the names. | function callAFunction { someFunction(); } |
function[a-z_$][a-zA-Z0-9_$]*{[\r\n][a-z_$][a-zA-Z0-9_$]*\(\);[\r\n]} | |
Code a function call whose argument is another function call. Make up the names. | doSomething(doSomethingElse()); | [a-z_$][a-zA-Z0-9_$]*\([a-z_$][a-zA-Z0-9_$]*\(\)\); | |
Code an alert whose content is a function call. Make up the name of the function. | alert(doSomething()); | alert\([a-z_$][a-zA-Z0-9_$]*\(\)\); | |
Code a function that has two string parameters. It passes the same parameters as arguments to a second function that concatenates the two strings. The first function returns the result that comes back from the second function. All of this functionality requires just three lines of code. Make up the names. | function lazyFunction(string1, string2) { return concat(string 1, string2); } |
function[a-z_$][a-zA-Z0-9_$]*\(([a-z_$][a-zA-Z0-9_$]*),([a-z_$][a-zA-Z0-9_$]*)\){[\r\n]return[a-z_$][a-zA-Z0-9_$]*\(\1,\2\);[\r\n]} | |
Code a function call whose argument is a second function call. The second function call passes one string as an argument. Make up the function names and the string. | doSomething(doSomethingElse("Bogata")); | [a-z_$][a-zA-Z0-9_$]*\([a-z_$][a-zA-Z0-9_$]*\(•.*•\)\); | |
|
|||
|