Promise to not get mad at me.
But there's actually one other thing I forgot to mention before we can talk about decorators.
I know I'm building the suspense.
I know you're just thinking, Hey, hey, Andre, tell me what a decorator is.
You're wasting my time.
But one more thing.
Quick video, I promise.
We have to understand this idea of a higher order function that is a higher order function or hoc for
short.
Sounds super important, right?
A higher order function can be one of two things.
It could either be a function, let's say the greet function that accepts another function.
So this right here is a higher order function.
It's a function that accepts inside of its parameters.
Another function.
Another way it can be a higher order function is if it's a function that returns another function.
If we define, let's say greet to that just runs normally, but instead returns another function.
So let's say in here we have define func.
And this defined funk, let's say, just returns five.
And we return the function.
This is a higher order function.
A higher order function is any function that either accepts a function as a parameter.
Or returns a function.
And if you're thinking, hey, is that map function that we talked about, is that a higher order function
because it accepts a function?
Yep, that's a high order function.
So is reduce.
Or filter.
These are all higher order functions.
All right.
I promise.
In the next video, we're going to talk about why this is important and what decorators are.
I'll see you in that one.
Bye bye.