Can I count on nodeIDs mapping is completed every time doSomething() is called?
nodeIDs = $.map(nodeIDs, function(n){
return n.match(/\\d+$/);
});
doSome
This function is synchronous - otherwise it couldn't return the result of the map operation.
Any callbacks that might take longer time (mainly due to IO) are asynchronous in nodejs - unless the method is explicitely marked as being synchronous (such as fs.readFileSync - but that doesn't use a callback). You probably confused that somehow.