The synchronous version (simplified for readability) of what I\'m trying to do in node.js:
var value = null;
var allValues = [];
do{
value = getValue(value); /
I'll hit a stack limit
No, you won't. If they're really asynchronous, then the next call to iteratGetValue
will be in a new stack frame - originating in the top-level execution context of the async callback handler. It's the same for Promises - some of which are even required to be asynchronous.