AmpersandJS / amp

a collection of individual JS utility modules
http://amp.ampersandjs.com
MIT License
130 stars 12 forks source link

first or find method #49

Closed tnguyen14 closed 9 years ago

tnguyen14 commented 9 years ago

Is there a way to find the first match in a collection/ array without iterating through the entire collection? I can currently use filter and then get the first element in the result array. However, this is not very fast for large collections.

wraithgar commented 9 years ago

Not yet https://github.com/AmpersandJS/amp/pull/17

HenrikJoreteg commented 9 years ago

closing, as this will be resolved when we merge @wraithgar's PR