How to pass a callback as a parameter into another function
Yup. Function references are just like any other object reference, you can pass them around to your heart’s content. Here’s a more concrete example: function foo() { console.log(“Hello from foo!”); } function caller(f) { // Call the given function f(); } function indirectCaller(f) { // Call `caller`, who will in turn call `f` caller(f); } … Read more