Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
Now that you've created an arrow function with no arguments, what does it look like with single and multiple arguments.
This video doesn't have any notes.
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
The error functions we've written so
far, have had no arguments.
0:00
What do they look like
if there are arguments?
0:04
Let me show you.
0:07
First, let's create error functions
that take a single argument.
0:08
Open up the second JavaScript file, and
we're going to modify the function square,
0:12
and cube for each function let set
up variables with appropriate names.
0:18
Square, And cube.
0:23
Next, remove the function keyword and
each of the functions names.
0:31
Finally, add arrows to
each of the functions.
0:41
As you can see,
0:47
the syntax is exactly the same with
a single argument as with no arguments.
0:48
Let's see what's an arrow function
looks like with multiple arguments.
0:56
Open up the third file and let's convert
multiply into an error function.
1:02
Start by assigning the function
to a multiply constant variable.
1:08
Then, remove the function keyword and
the function name.
1:16
Finally, at the arrow.
1:22
There's also add and subtract here.
1:25
These need to be converted to our syntax,
too.
1:29
Why don't you convert these for practice?
1:31
In the next video,
1:34
we'll take a look at an even more
concise way to write our functions.
1:35
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