DEV Community

Discussion on: JS interview in 2 minutes / Higher Order Functions

Collapse
 
mazentouati profile image
Mazen Touati

Nice read Nikita!

It would be more insightful to clearly state that Higher Order Function should meet one of these conditions or both of them:

  • It returns a function
  • It accepts at least one function as a parameter (Like reduce that's being used in the example).
Collapse
 
hexnickk profile image
Nick K

Hey, thanks for the comment!

That's totally right, needed to double-check the definition, my bad. I've added an update note with a mention to the second section πŸ™

Thanks again!

Collapse
 
kettanaito profile image
Artem Zakharchenko

Yeap, that's completely true. The original short definition:

These are functions that return other functions.

Should be changed to something like:

These are functions that accept a function as an argument or return other functions