16.3: ES6 Arrow Function – Topics of JavaScript/ES6




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”

  1. 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

  2. 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!

  3. 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.

  4. 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.

  5. 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

  6. 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.

Leave a Reply