当使用node.js async forEachSeries时,是否有等价的语句来“继续”?

我正在使用node.jsasynchronous包,特别是forEachSeries,根据从数组中绘制的参数进行一系列http请求。 在每个请求的callback中,我有一些if / else语句来响应不同types的响应。

// 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 } } 

是否有一个相当于'继续',我可以使用里面的其他如果上面? 这在技术上不在循环内,所以继续不起作用。

既然它只是一个函数,你应该能够从它return来具有相同的效果:

 else if (!response.results) { return; }