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
Simplify and refactor three 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
Let's jump right in to the solution for
the refactor.js style.
0:00
Our first function in this file,
multiplied by 10,
0:01
will run just fine, but
could be written more concisely.
0:05
Any ideas?
0:08
One thing we could do, is remove
the parentheses around the num parameter.
0:10
Because we're only passing in one
parameter, we don't need them, what else?
0:14
Well, because our function
only has one line of code,
0:19
we don't actually need our curly braces or
the return key word.
0:23
Our entire function can go on one line.
0:27
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