Higher Order Functions in JavaScript Explained Simply

  Рет қаралды 5,538

Teddy Smith

Teddy Smith

Жыл бұрын

Higher Order Functions & Callback Functions in JavaScript Explained Simply
Linkedin: / teddy-smith-015ba61a3
Website: www.teddysmith.io
Github: github.com/teddysmithdev
In JavaScript, a higher-order function is a function that takes one or more functions as arguments, or returns a function as output. These functions are a powerful feature of the language that allow you to write concise and expressive code.
The best way to learn higher order functions (and likely the most “real-world”) is to look at “map()” and “filter()”. Both take functions as arguments where the function is applied to each element in an array.
Map
For example, consider the map function, which is used to apply a function to each element of an array and return a new array containing the results.
The map function is a higher-order function because it takes a function as its argument, in this case the function to apply to each element of the array.

Пікірлер: 20
@julieyeaeun
@julieyeaeun 9 ай бұрын
I'm mad I didn't find your channel sooner. God tier instructor... thank you!!!
@andriibibik39
@andriibibik39 9 ай бұрын
That's exactly what I was looking for. Thanks!
@eyoutube1
@eyoutube1 9 ай бұрын
You, sir, now have a new subscriber. Great lesson, thank you!
@mohabdulai7238
@mohabdulai7238 6 ай бұрын
Wow 👏.. You've just simplified everything to my understanding. I'm your new subscriber.
@petrapaul2434
@petrapaul2434 10 ай бұрын
Thank you so much ! ❤
@benejix
@benejix 10 ай бұрын
I love you for this bro.
@_onlyFran_
@_onlyFran_ 3 ай бұрын
+1 subscriber, There is no way to make a simpler explanation. Thank you so much.
@TeddySmithDev
@TeddySmithDev 3 ай бұрын
No prob. Sweet name lol
@PKcCB
@PKcCB 5 ай бұрын
Awesome explanation! Thank you very much! The explanation with the return()() helped me a lot :D
@caseyspaulding
@caseyspaulding Жыл бұрын
Haha you make these video’s entertaining and educational 👍
@TeddySmithDev
@TeddySmithDev Жыл бұрын
I notice when I say something crazy in the beginning the watch time goes up Lmao
@caseyspaulding
@caseyspaulding Жыл бұрын
@@TeddySmithDev yea man I think you are onto something. Lol. Then I learn about roided out function passing to another function. Pretty cool haha
@TeddySmithDev
@TeddySmithDev Жыл бұрын
lmao
@DarrylHebbes
@DarrylHebbes 7 ай бұрын
Partial application
@grahamtech
@grahamtech 3 ай бұрын
this actually made it more confusing
@grahamtech
@grahamtech 3 ай бұрын
nvm it actually makes sense now lol
@TeddySmithDev
@TeddySmithDev 3 ай бұрын
I real life laughed lol
@ExpatTraderFX
@ExpatTraderFX Жыл бұрын
G0D approves
@halalmeatshophk
@halalmeatshophk 4 ай бұрын
you just explained how it is done. but the important thing to know is why is it done this way? wrapping a function using another function, why? what r the benefits? it seems extra useless step.
@TeddySmithDev
@TeddySmithDev 4 ай бұрын
so that you can execute code within code. also, the code can be modified and changed to whatever you want because it is being passed in. instead of hard coding it you just pass it in.
Higher Order Functions - JavaScript Tutorial
10:10
ColorCode
Рет қаралды 57 М.
JavaScript Higher Order Functions & Arrays
34:56
Traversy Media
Рет қаралды 974 М.
1 класс vs 11 класс (рисунок)
00:37
БЕРТ
Рет қаралды 2,4 МЛН
He FOUND MYSTERY inside the GUMMY BEAR 😱🧸😂 #shorts
00:26
BROTHERS VLOG
Рет қаралды 54 МЛН
Don't Waste!🚫 Turn Ham Into Delicious Food😊🍔 #funnycat #catmemes #trending
00:25
JavaScript Hoisting Explained Simply
6:30
Teddy Smith
Рет қаралды 2,2 М.
Higher Order Function | javascript interview series
11:46
Hitesh Choudhary
Рет қаралды 25 М.
Callbacks in JavaScript Explained!
14:03
Code with Ania Kubów
Рет қаралды 148 М.
Learn Pure Functions In 10 Minutes
10:11
Web Dev Simplified
Рет қаралды 140 М.
NodeJS 22 Just Dropped, Here's Why I'm Hyped
14:31
Theo - t3․gg
Рет қаралды 31 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Every JavaScript Developer Has Made This Mistake With Functions
7:17
Web Dev Simplified
Рет қаралды 102 М.
JavaScript ES6 Arrow Functions Tutorial
9:32
Web Dev Simplified
Рет қаралды 806 М.
Giường cũi cho em bé - Xưởng giường ghép KID  #giuongcui #giuongghep
0:21
Giường ghép cho bé
Рет қаралды 4,8 МЛН
The Colour Combination 🧡💜💙 HELP #shorts #shortswithcamilla
0:28
the end 😂😂😂 #shorts #shortvideo #youtubeshorts #funny #fails #humor
0:50