DEV Community

Discussion on: Functional programming basics part 2: Higher order function

Collapse
 
stevetwitte profile image
Stephen Taylor Witte

If your code had to call a function depending on some other logic, you could return the function to call from the function that decides. Make sense?

Collapse
 
alvarocaceresmu profile image
Álvaro Cáceres Muñoz

You mean something like returning different functions in a switch statement, for example?

Thread Thread
 
stevetwitte profile image
Stephen Taylor Witte

Right

Thread Thread
 
alvarocaceresmu profile image
Álvaro Cáceres Muñoz

Now I get it, thanks!