Skip to content

bttmly/collection.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collection

Warning: Deprecated

This approach is not performant nor particularly elegant. Check out [super-collection(https://github.com/nickb1080/super-collection) for a much better implementation.

Collection is a simple JS class with the “collection methods” from Lo-Dash/Underscore mixed into the prototype. To enable easy chaining, methods that would ordinarily return arrays return instances of Collection instead.

Methods returning a Collection instance:

forEach, each, eachRight, forEachRight, map, collect, filter, select, where, pluck, reject, invoke, initial, rest, tail, drop, compact, flatten, without, shuffle, remove, transform, unique, uniq, union, intersection, and difference.

Methods that return other things:

reduce, foldl, inject, reduceRight, foldr, find, detect, findWhere, every, all, some, any, contains, max, min, include, size, first, last, indexOf, lastIndexOf, isEmpty, toArray, at, findLast, indexBy, sortBy, and countBy.

About

Collection class that has Lo-Dash/Underscore collection methods in the prototype

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors