Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- 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
Start a free Courses trial
to watch this video

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
JavaScript lets you assign default values to your function parameters. That way, if, for any reason, you do not pass a specific argument to a function, the function uses (or falls back to) the default value.
Resources
Code Snippets
function getArea(width, length, unit) {
const area = width * length;
return `${area} ${unit}`;
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Andrew Terrett
2,079 Points1 Answer
-
Tural Rzazade
3,750 Points1 Answer
-
Anthony Manriquez
2,917 Points2 Answers
-
John D
7,237 Points4 Answers
-
Manoj Gurung
5,318 Pointsseriously the same code doesn't work in mine why is that
Posted by Manoj GurungManoj Gurung
5,318 Points1 Answer
-
ja5on
10,338 Points7 Answers
-
Tara K
1,863 Points1 Answer
-
Kathryn Kupunihi
3,753 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up