passing 2 callback functions in interval javascript code example
Example: Pass functions, not strings, to setTimeout() and setInterval()
setInterval(doSomethingPeriodically, 1000);
setTimeout(doSomethingAfterFiveSeconds, 5000);
setInterval(doSomethingPeriodically, 1000);
setTimeout(doSomethingAfterFiveSeconds, 5000);