JavaScript Higher Order Functions in 1 Minute #shorts

preview_player
Показать описание

What is a Higher Order Function in JavaScript?
Why do we need Higher Order functions?
And how can you use them to your advantage?

Higher Order Functions from the series "10 Things JS Developers Should Know"
Рекомендации по теме
Комментарии
Автор

So far you’re my favorite coding instructor, I really appreciate your content — both the shorts & the long form. 🙏🏾

Wildenfree
Автор

there is error in your code.
it should be return function(size) {} // you are mising size parameter

Javatician
Автор

I'm currently learning React. These videos are helping me reinforce the new knowledge 🤝🏽🤝🏽

KaraboMoremi
Автор

There is no need for a higher function in this case. Just do a regular function which takes the px as Argument and sets it to the body properly.

its_oz
Автор

Binging all your shorts before my web dev endsems.😅

beforeikillyou
Автор

That thing you can also do without using HOF by using simple function that takes size and return that style

muhammedhuzaifa
Автор

Basicaly a HOF is like a way to sneak a property onto another function that has to do the job.

pixbug
Автор

one more thing to add... an higher order function can do both.... take and return

holuhola
Автор

Why are we giving new names to lambda functions and factory functions?

bob_kazamakis
Автор

Shouldn’t ‘function makeClickHandler’ take the size parameter?
For eg:
function makeClickHandler(size)

fieryscorpion
Автор

I'm on my phone. I need to save this short to a playlist. I CAN'T 😭 pls help.

elatedbento
Автор

Why not just write a first order function for the click handler that takes the font size as an argument

chrisrock
Автор

const hoc = (WrappedComponent) => (props) => {
return (
<div>
<WrappedComponent {...props}>

</WrappedComponent>
</div>
)
}

Simple example of higher order component

AdnanDeveloperConsole
Автор

Didn't get it(
What's the point of using function inside a function in that case?

DainSPb
Автор

I understand it u handleClick but still this example don't fit here

muhammedhuzaifa
Автор

const buttons =

buttons.forEach(button => {
button.onclick = () => {
button.style.fontSize = `${button.innerText}px`;
};
});


// better or worse??
// simpler or more complicated??

RaresMarianRosca-jxyn
Автор

better learn what hof actually is then making it lang specific

Dmytro-ktfr