i++) { var _ret = (function (i) { getPage(i, function (items) { pages[i] = items; }); if (i % 2) return "continue|pageLoop"; if (i === 5) return "break|pageLoop"; return { v: "pages!" }; })(i); switch (_ret) { case "continue|pageLoop": continue pageLoop; case "break|pageLoop": break pageLoop; default: if (typeof _ret === "object") return _ret.v; } } References inside a closure with a label, continue, break and return… var pages = []; pageLoop: for (let i = 0;; i++) { getPage(i, function (items) { pages[i] = items; }); if (i % 2) continue pageLoop; if (i === 5) break pageLoop; return "pages!"; }