Javascript examples for Function:Function Variable
Pass function as a parameter
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> <script> function myFunction(callback) {/*from ww w .j av a2 s . c om*/ console.log("I'm about to run the callback"); callback(); } myFunction(function() { console.log("Inside the callback"); }); </script> </body> </html>