Arrow functions are (pretty much) a shorter function syntax in JavaScript. Because of their extreme terseness, arrow functions allows us to use use functions in a new way, making lots of functions that are small, inline and single-purpose.
Table of contents:
00:18 ► What are arrow functions in JavaScript
00:53 ► Why use arrow functions in JavaScript
02:39 ► How to use arrow functions in JavaScript
07:41 ► Boilerplate problem with vanilla functions in JavaScript
09:36 ► Refactoring vanilla JavaScript functions to arrow functions
10:25 ► Implicit returns in arrow functions
13:36 ► Short argument names in arrow functions example
15:58 ► Summary of arrow functions in JavaScript
I’m also active on:
► Twitter https://twitter.com/mpjme
► Medium https://medium.com/@mpjme
► Quora https://www.quora.com/profile/Mattias-Petter-Johansson
Resources:
► .filter explained
► .map explained
► .reduce explained
► Fun Fun Function channel
https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q
► Code from the episode
https://gist.github.com/mpj/8256bdfae3168733a0bf733c604142d0
► Music by 7 Minutes Dead
Original source
24 responses to “Arrow functions in JavaScript – What, Why and How – FunFunFunction #32”
In other programming language, such as C# or Java, this is called lambda expression, am I right?
What is "event." and (prev || 0)?
Its really having Fun to learn from FunFunFunction. 🙂
At 5:51 you are applying filter twice< which iterates the list twice. Why not do both filter conditions in one filter clause?
Please someone video him from 2:39 to 2:43 en loop it, hilarious stuff
Hi! thank you for another video! Would it be nice to for you to make a video explaining how arrow functions are related to `this` ?
Unless you're developing for IE 🙁
Is there a video where you cover how "this" is different in arrow functions?
which console did you use to get that sheep pls?
Because you are filtering object in array, more readable would be ".filter(object => object.type === "attack")"…
you should throw in some physical exercise daily. it will save your shoulders and posture also. my opinion is the wrist stuff is analogous to traffic controllers that hold the stop-signs all day. the 90 degree bent albow for extended periods can cause the "tennis elbow". i recommend researching it a bit more now that its been a year and try to improve your long term strategy a bit 🙂 call it an incremental development on your body.
Hi, Can you do the videos on RxJs , TypeScript and ES6…
You're the best, MPJ! I would watch you even if you tell total bull&hit because you're so awesome! Thanks for nice show, it's good. Looking forward to see more stuff like normal deviation.
for the first time i hear the opening, i thought you saying "Hi, i mmpj". LOL
Where I come from, { } are braces, [ ] are brackets, and ( ) are parenthesis 🙂
Just discovered your channel (like 5 hours ago actually) and couldn't stop watching all the amazing content you produce. Thanks a lot for combining a lot of "knowledge-giving" with your fun and awesome personality. Well done
(() => "'{' = 'left brace'")()
birdwings == curlybrackets.
Super teaching method, thank you for the fun !!
klammerparenteser == Curly Braces
nicely explained. 🙂
7:15 Bhahahahaa
awesome video. btw, target is pronounce like "targit" not "tarjet". Sorry if that's annoying. Otherwise your English is 4 million times better than my Swedish
What theme and schema you use?
I'm wasting my life because I have to repeat your "real MPJ" moments like 43432423424111 times.