I want to know how Javascript handles callbacks inside a recursive call, are the callbacks pushed right into the queue on each of the recursive calls or after the call resolves with a base case?
Test case code
function enums(start,end,callback) {
callback(start);
if (end == 1)
return 1;
else{
return enums(start + 1, end - 1, callback);
}
}
var callback = function (number){
console.log(number);
}
enums(1,10,callback);