Lodash: Suggested _.forOwn Documentation Update

Created on 3 Jun 2016  路  3Comments  路  Source: lodash/lodash

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 simple return; statement (similar to a continue; statement in a normal loop).

documentation wontfix

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 return and return false here?"

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sarahquigley picture sarahquigley  路  3Comments

JoMas971 picture JoMas971  路  3Comments

rtheunissen picture rtheunissen  路  3Comments

aj0strow picture aj0strow  路  3Comments

SameerSiddiqui picture SameerSiddiqui  路  3Comments