Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Arrow Functions in JavaScript!
You have completed Practice Arrow Functions in JavaScript!
Preview
Turn regular function declarations into arrow function expressions.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
with arrow syntax right now.
0:00
Let's with the first one, addToTen.
0:00
This is a simple function that receives
parameter num, adds num to 10 and
0:03
then returns the sum.
0:08
To begin,
0:10
let's first replace the function keyword
with variable declaration keyword, const.
0:11
Then we add an equal sign, followed by
the parameter that we're passing in.
0:17
But remember, because we're
only passing in one parameter,
0:22
we don't need to enclose
it in parentheses.
0:25
After the parameter we type our arrow
which points to the code inside our
0:29
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