Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can this be called recursive?

function move() {

    pos = pos+1;

    t = setTimeout(move, 100); 
}

Can that be called recursive? If yes, could you provide any reference?

like image 665
YOU Avatar asked Jan 13 '10 07:01

YOU


1 Answers

No, the difference between recursion (func_a calls func_a) or indirect recursion (func_a calls func_b calls func_a) is that using a timer for repetitive calls will (decoupling) not grow the stack and previous state is lost.

like image 58
stacker Avatar answered Sep 18 '22 13:09

stacker