Pass a function as an argument to another function in JavaScript

https://www.reddit.com/r/learnjavascript/comments/m8vlsb/can_someone_explain_how_to_pass_a_function_as_an/