You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition, in Lodash, returning false in a forEach callback exits early. This would be useful in node#each for performance optimisations for custom iteration functions.
Happy to submit a PR if you want to go in this direction.
The text was updated successfully, but these errors were encountered:
I wouldn’t support short-circuiting node.each if the callback returns false, though; that would not be backwards compatible nor consistent with standard array methods. It’d be better to either use node.find for that purpose, or if we like, we could have node.some and node.every methods equivalent to the standard array methods.
mbostock
changed the title
Implement node#find, shortcut return node#each
node.find?
Oct 22, 2019
It would be useful to have a
node#find
function.In addition, in Lodash, returning
false
in aforEach
callback exits early. This would be useful innode#each
for performance optimisations for custom iteration functions.Happy to submit a PR if you want to go in this direction.
The text was updated successfully, but these errors were encountered: