node.js async パッケージ、具体的には forEachSeries を使用して、配列から引き出されたパラメーターに基づいて一連の http 要求を作成しています。各リクエストのコールバックには、さまざまなタイプのレスポンスに応答するための if/else ステートメントがあります。
// 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
}
}
上記のelse ifの中で使用できる「continue」に相当するものはありますか? これは技術的にはループ内ではないため、続行は機能しません。