I am using the node.js async package, specifically forEachSeries, to make a series of http requests based on parameters drawn from an array. In the callback of each request I have some if/else statements to respond to different types of responses.
// This is the callback of a GET request inside of a forEachSeries
function(error, response) {
if (response.results) {
// Do something with results
}
else if (!response.results) {
// Would like to use a continue statement here, but
// this is not inside of a loop
}
else {
// Do something else
}
}
Is there an equivalent to 'continue' that I can use inside of the else if above? This is not technically inside of a loop so continue does not work.
continue
statement inside a control structure likeif/else
. What exactly are you trying to do? 'Cause it looks to me like you need to review your logic... – Calhoun