Is it possible to create a universal setTimeout and setInterval function with corresponding clearTimeout and clearInterval for all functions while passing values to them?
The situation is as follows:
1. More than 8 functions utilizing setInterval for actions like fadeIn/fadeOut/toggleClass, etc.
2. More than 4 functions using setTimeout for actions like fadeIn/fadeOut/toggleClass, etc.
3. Only one function (setInterval/setTimeout) should be active at a time, switching to another once the current cycle finishes.
4. How can specific function values be passed/sent to these functions?
For example:
function one() { ... }
function two() { ... }
function three() { ... }
function four() { ... }
function five() { ... }
ctimeout = setTimeout(function(){ ... }, time);
sinterval = setInterval(function(){ ... }, time);
clearTimeout(ctimeout);
clearInterval(cinterval);
So, how do we assign functions to setInterval or setTimeout while ensuring only one runs at a time?