- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
Closed
Description
Hi
As part of an assignment before a JS bootcamp, I had to re-write some of the Underscore functions - sometimes in a simplified version. I just had a look at the original implementation of _.some, and I thought I might suggest simply (your adaptation of) this instead:
_.some = function (collection, predicate, context) {
  return !_.every(collection, (e, index) => !predicate.call(context, e, index, collection));
};
It's based on
- 'some = true' being equivalent to 'none = false', and
 - 'none w/ predicate A' being equivalent to 'every w/ predicate non-A'.
 
What do you think?
Metadata
Metadata
Assignees
Labels
No labels