I am analyzing some code from a book I am reading and there is a small piece that confuses me a little bit:
//... some code
setTimeout(function(){
//...some code
if(some condition)
setTimeout(arguments.callee, 0);
}, 0);
What is a little confusing for me is that the same book mentions that the "callee" property has been deprecated and that it should not be used unless strictly necessary (I am paraphrasing). So I am wondering if this is one of those cases or if there could be a better way to accomplish the recursive call. Somewhere on the internet I read that the following may accomplish the same thing:
//... some code
setTimeout(function myRecursiveFunction(){
//...some code
if(some condition)
setTimeout(myRecursiveFunction, 0);
}, 0);
Is this correct? Is there yet a better way to approach this? Is it safe and ok to keep using arguments.callee?
Thank you for any clarification.