In this video, I cover anonymous functions with the arrow syntax in ES6 JavaScript.
Next Video on ES6: https://youtu.be/Y8sMnRQYr3c
Support this channel on Patreon: https://patreon.com/codingtrain
To buy Coding Train merchandise: https://www.designbyhumans.com/shop/codingtrain/
To Support the Processing Foundation: https://processingfoundation.org/support
Send me your questions and coding challenges!: https://github.com/CodingTrain/Rainbow-Topics
Contact:
Twitter: https://twitter.com/shiffman
The Coding Train website: http://thecodingtrain.com/
Source Code for the all Video Lessons: https://github.com/CodingTrain/Rainbow-Code
p5.js: https://p5js.org/
Processing: https://processing.org
For an Intro to Programming using p5.js: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
For Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
Help us caption & translate this video!
https://amara.org/v/cJ4E/
๐ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
Original source
34 responses to “16.3: ES6 Arrow Function – Topics of JavaScript/ES6”
conciseness is not a valid reason for doing this tbh. It's so difficult to read…. it's not worth the conciseness. Why are we all having to use Javascript… I freaking hate javascript.
14:31–14:41 priceless!
Readable es5 Js making it harder and unique to other languages using es6, you're not really making this easy es6 I have other languages to maintain too. This is spooky indeed
I agree, to try new thing in programming is also interesting/exiting/spooky/terrifying/and whatevea, I used to avoid these things, but even if you say there is no reason to be afraid of them, you will always find something you don't want to start using, thanks Theacher Shiffman for encouraging us to try new things
Let Like => true
I legitimately can't tell which of the errors were intentional and planned and which were surprise errors that he expected to work. Fascinating to see him troubleshoot live though. Also Happy Halloween!
its a bit over the top for me, but the explanations are fine
23-10-2019 I'm also watching it near halloween don't worry
It's unfortunate that PHP's "=>" syntax has a totally different semantics than ES6's. That's going to confuse people. ๐
Literally watching it now and Halloween is so close. =
Amazes me how stereotypical all nerds are still in this day. Like flamboyant gay kids basically..
You are the best
is he homo?
You are amazing. It didn't solve my question but… I learned new amazing things and also discovered you. From a begginer in programming in Spain, thank you and keep it up!
It feels like you lose all transparency when you use this operator. It's cool to use it for lambda operations, but people are using this to make pointless one-liners.
Wow, you are awesome.
Cheers from Brazil ๐
This is what a man who loves coding and teaching looks like!
the whole arrow function can be improved in JS honestly. Instead of doing this: button.mousePressed(() => background(random(255))); , you should be able to do this: button.mousePressed(>background(random(255))); … JS should understand what that means. It should say "oh, no arguments? ok. uhm. But I see a right arrow, so it looks like an arrow function" and know what to do under the hood. It can't be that complicated to make for JS as an alternative to the first example at the top of this comment. I'm newer to JS, but that's just an observation. Also, being new, I'm not sure if this is possible or not, but we should be able to do r(255) for a random value by default instead of random(255). I know you can make a new function called r and essentially do the same thing.
Also, it would be nice if we could create one line functions in JS without doing anonymous arrow functions and it's not being called from inside a method of some sort. I'm not sure if it's possible or not, but at first glance on Google, it's not. Something like this "function myFunction({(greeting) => return alert("hey")})" on one line. I don't even think that would work but it's an idea.
Rick? Rick Moranis, is that you????
Be great if Coding Train touched on say Python.
Watching 22 minutes of him not having a clue how a class in es6 should look like.
oh my god, you made my day easier……thank you!~!
You are a great teacher.But the face of curly brackets you make are so ugly that only a mom could it ๐
Yes , sure 22:10 ๐
Never in my entire life have I ever felt so much discomfort and anxiety over something as trivial as 2 bytes of tormenting equality symbols! Some nights when I don't get some sleep, I think it's because of the => like it's some kind of evil emoji jeering at me.
Who's this spooky guy? He's kind a awesome…and very understandable though. ๐
this guy has me dead
Are arrow functions the same thing as lambda expressions?
Half of us donโt know what is computer language others know about html and JavaScript or some other language and we have some beginners and some advance and a few expert that function short cut only for experts witch it we donโt have much expert also experts wonโt watch that video so the short cut for beginners and advance not help him including me
Hi Dan,
As a beginner, I just want to let you know that your error is more valuable than the actual code that works. It saves me hours of time to figure out what's wrong with my code. That is why I always following your channel and reproducing the code that you made. Thanks for the information sharing.
This guy moves so much it gave me a siezure
Great video, thanks!
2:08 function don't go away from me
You are very handsome