I suggest the following change to the _.forOwn docs (and maybe the docs for other iteration methods as well):
Change:
Iteratee functions may exit iteration early by explicitly returning false.
To:
Iteratee functions may exit iteration early by explicitly returning false (similar to a
break;statement in a normal loop). Iteratee functions may also skip an iteration with a simplereturn;statement (similar to acontinue;statement in a normal loop).
I think that's a bit too much. We cover the distinguishing bits.
@jdalton I just googled "Iteratee functions may exit iteration early by explicitly returning false" from the docs in order to get a better understanding of the meaning of the statement. And I landed here.
The proposed change by @bryandowning made me understand the meaning instantly. So as a reader of the lodash documentation, I don't think it is too much.
When reading the original documentation I was wondering: "What is the difference difference between return and return false here?"
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@jdalton I just googled "Iteratee functions may exit iteration early by explicitly returning false" from the docs in order to get a better understanding of the meaning of the statement. And I landed here.
The proposed change by @bryandowning made me understand the meaning instantly. So as a reader of the lodash documentation, I don't think it is too much.
When reading the original documentation I was wondering: "What is the difference difference between
returnandreturn falsehere?"