I don't understand how this is fundamentally different from just doing it in regular javascript. You could write a javascript function that recurses forever on condition x:
just write a function that calls itself with the same parameters unless condition x is met. How is it fundamentally different if the type system does it?