In this video, I discuss “higher order functions” in JavaScript.
π₯ Next Video: https://youtu.be/EnYlhbpzhU4
π₯ Topics of JavaScript/ES6: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YgpA3Oht-7B4NBQwFVe3pr
π₯ ES6 Arrow Function: https://youtu.be/mrYMzpbFz18
π₯ Closures in JavaScript: https://youtu.be/-jysK0nlz7A
π The Coding Train website: http://thecodingtrain.com/
π Support this channel on Patreon: https://patreon.com/codingtrain
π To buy Coding Train merchandise: https://www.designbyhumans.com/shop/codingtrain/
π Book recommendations: https://www.amazon.com/shop/thecodingtrain
π» https://github.com/CodingTrain/Rainbow-Code
π₯ For an Introduction to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ For More Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π https://p5js.org/
π https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
Original source
28 responses to “16.5: Higher Order Functions in JavaScript – Topics of JavaScript/ES6”
The syntax is not the only difference between arrow and regular functions. An arrow function does not create its own context, while regular ones do. This is something important to keep in mind.
I really admire all of your videos. Learning to code with you is exciting. I really appreciate how genuinely excited you are to share what you know with us!
I never knew programming could even be like this! This is incredible!
"A function that expects a function as a parameter, creates a function and/or returns a function." – this did it for me. Thank you!!!
7:25 me whenever I see food.
You are the best! You solve my questions about high-ordered functions!
I accidentally set the tripler factor to 4 and when changing it to three I got an error telling me identifier tripler had already been declared. It's a "let" declaration ……?
wow thanks! π
FINALLY! A coding demonstration channel with personality!
The energy was infectious and actually funny which is wayyyyyyyy more than you can say about any of the other programming channels i've tried!
I like your teaching
Hi thanks for your videos you are awesome healthy guy!
I have one question cus i am a beginner, I see this first time, how can you pass a number into a variable 'doubler(4)' and that variable knows that you are referring to returned x parameter??? How and why it knows that, how is that linked?
So I tried shortening the whole thing up and came up with this:
let add = addition => { return x => x + addition; }
Same with multiple, just as an addition.
11:30
const multiplier = factor => x => x * factor;
π
Ahh why this all confusing like this ;-;
I guess I need to try it again tomorrow. This shit gives me headache
You are very funny!
Nice
you are very majectic the way you teach, bahaha it works!
damn! I just subscribed and enjoy how you present this!
What's crazy is you could also do
const multiplier = factor => x => x * factor
In fact, if you wanna get extra crazy, you can keep nesting the pattern as far as you want.
I seriously love JS.
awesome, a simple way to explain it
What ide do you use for js programming?
You have very strict and serious description:
"In this video, I discuss "higher order functions" in JavaScript."
But, in the video it is opposite. Smoke weed everyday
What this guy smokes before every video? Anyway good job
Can get even more cryptic if you want… let multiplier = factor => x => x * factor;
hey thanks for this!
arrow functions corrupt my brain
The code executed is 4 x 2 right? not 2 x 4 isn't? at 15:10