Onended in forloop

Hi I just have a question :)) Can you easily put “onended” in a for loop with Javascript?

Can you explain what you mean? When a for loop finishes, it just goes into the next block of code.

for (/* loop logic */) {
  // Do stuff in a loop
}
// Loop is done, do some more stuff

What language are you coming for that has explicit constructs to handle it ending?

Python has a curious “feature” where one can add an else clause that will execute if the loop exits normally, but not if a break was used. Normally I love python’s syntax and semantics, but that one is just a dreckish antipattern.

2 Likes

Ugh, that’s ugly. It’s so anti-pythonic.