#Alternative ways to pass a callback to a function in Javascript
Javascript is extremely flexible, encouraging us to find alternatives to almost any possible expression or statement. For example, passing a callback function to another function can be done in different ways.
Because a function is an object in Javascript, it can be passed to another function as an argument and executed later. Callbacks let us defer the code execution to the moment it's really needed.
function waitAndCall(func)
{
setTimeout(func,parseInt(Math.random()*10000));