What about doing a break; here instead of having isContinuous === undefined as part of the while condition?
At least I am surprised about this code, not often seen that pattern.
Using "break;" at least would have runtime advantages: isContinuous === undefined is not always checked, and once we have the result the rest of the loop code is skipped.