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
Fill in the blank to complete the first line of an arrow function. | const greet = () ___ { | => | => |
Fill in the blank to complete the first line of an arrow function. | const greet = _______ { | () => | \(\)=> |
Rewrite this code as the first line of an arrow function. | const greet = function() { | const greet = () => { | constgreet=\(\)=>{ |
Code the first line of an arrow function that includes two parameters. Assign the function to the constant x. Make up the parameter names. | const x = (a, b) => { | constx=\([a-z_$][a-zA-Z0-9_$]*,[a-z_$][a-zA-Z0-9_$]*\)=>{ | |
Code the first line of an arrow function that includes one parameter. Assign the function to the constant x. Code the shorthand version. Make up the parameter name. | const x = a => { | constx=[a-z_$][a-zA-Z0-9_$]*=>{ | |
Code an arrow function with one parameter. The function displays the parameter value in an alert. Assign the function to a constant. Code the shorthand version. Make up everything. | const x = a => alert(a); | const[a-z_$][a-zA-Z0-9_$]*=([a-z_$][a-zA-Z0-9_$]*)=>alert\(\1\); | |
Code an arrow function that has one parameter. The function returns the parameter value. Don't code the shorthand version. Make up the constant and the parameter. | const x = (a) => { return a; } |
const[a-z_$][a-zA-Z0-9_$]*=\(([a-z_$][a-zA-Z0-9_$]*)\)=>{[\r\n]return\1;[\r\n]} | |
Code an arrow function with one parameter that returns the parameter value. Assign the function to a constant. Code the concise version. Make up the constant and the parameter. | const x = a => a; | const[a-z_$][a-zA-Z0-9_$]*=([a-z_$][a-zA-Z0-9_$]*)=>\1; | |
|
|||
|