Closed Bug 1250034 Opened 10 years ago Closed 10 years ago

Add note to Array.forEach() that .find() .findIndex available

Categories

(Developer Documentation Graveyard :: JavaScript, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tshinnic, Unassigned)

References

()

Details

:: Developer Documentation Request Request Type: Correction Gecko Version: unspecified Technical Contact: :: Details (here cuz logins are broken on MDN) Array.forEach() doc page has added "Note:" that .forEach() may be "the wrong tool" as iteration can't be stopped early. The note mentions .every() and .some() may satisfy the need for different behaviour. The note does not mention the newer APIs .find() and .findIndex() which *do* allow early termination upon true predicates. It is perhaps more important to mention these than .every()/.some()
Thanks, added!
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.