Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Create Functions Using Arrow Syntax 4:34
- Concise Arrow Function Syntax
- Arrow Functions Review 5 questions
- Default Function Parameters 5:11
- Create an Arrow Function 1 objective
- Descriptive Comments for Functions
- Function Challenge 1:24
- Function Challenge Solution 4:28
- Testing for Number Arguments 4:02
- JavaScript Functions Review 6 questions
Instruction
Concise Arrow Function Syntax
Arrow functions are already less verbose than function declarations and function expressions, but you can write them in a more concise way.
Arrow Functions with One Parameter
If your arrow function accepts a single argument, like the square
function below, you can omit the parentheses:
const square = x => {
return x * x;
}
square(10); // 100