Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Using Arguments with Arrow Functions1:40 with Andrew Chalkley
Now that you've created an arrow function with no arguments, what does it look like with single and multiple arguments.
The error functions we've written so far, have had no arguments.
What do they look like if there are arguments?
Let me show you.
First, let's create error functions that take a single argument.
and cube for each function let set up variables with appropriate names.
Square, And cube.
Next, remove the function keyword and each of the functions names.
Finally, add arrows to each of the functions.
As you can see,
the syntax is exactly the same with a single argument as with no arguments.
Let's see what's an arrow function looks like with multiple arguments.
Open up the third file and let's convert multiply into an error function.
Start by assigning the function to a multiply constant variable.
Then, remove the function keyword and the function name.
Finally, at the arrow.
There's also add and subtract here.
These need to be converted to our syntax, too.
Why don't you convert these for practice?
In the next video,
we'll take a look at an even more concise way to write our functions.
You need to sign up for Treehouse in order to download course files.Sign up