Skip to content

Commit

Permalink
User internal reduce method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Paul Gorman authored and Jean-Paul Gorman committed Oct 10, 2017
1 parent 77e59cb commit 4557ddd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/without.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contains from './contains'
import reduce from './reduce'

export default function without(itemsToOmit, collection) {
return collection.reduce((accum, item) => !contains(item, itemsToOmit) ? accum.concat(item) : accum, [])
return reduce((accum, item) => !contains(item, itemsToOmit) ? accum.concat(item) : accum, [], collection)
}

0 comments on commit 4557ddd

Please sign in to comment.