Worst part is, I've seen devs wrap their entire for-loop in an anonymous function JUST so they could use a return; to break out of the loop, instead of using break;
Nothing is particularly “bad”. I’ve used them in python a number of times.
I’m more just commenting that it’s a strange / interesting code based worth sight seeing. It was written in a style that seemed like from another language.