Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Write a Callback as an Arrow Function0:50 with Guil Hernandez
Most of the time, you'll see the function passed to
forEach (callback function) written as an arrow function, using the new arrow syntax (
Most of the time you'll see the call back function, or the function being
passed to for each, written as an arrow function, using the new fat arrow syntax.
For example, I can shorten the function inside for
each by replacing the function keyword in parentheses.
With movie and a fat arrow which is just an equal sign immediately
followed by right angle bracket.
Better yet, arrow functions with one statement,
like this one, can be condensed to one line so
I can place everything on one line, like so.
You need to sign up for Treehouse in order to download course files.Sign up