DEV Community

Discussion on: Progress Indicator With Fetch

Collapse
 
samthor profile image
Sam Thorogood

It's honestly just preference! If you want to be pedantic, then my way is less work: the while (...) loop checks downloadIsDone even though we know it's false already, but this is splitting hairs.

FWIW, I write a lot of Go, which has a "naked" for loop: for { ... }, which I quite like—it's just the same as using (;;) in the body of a JS for loop.