https://github.com/bttmly/collection.js
Collection class that has Lo-Dash/Underscore collection methods in the prototype
https://github.com/bttmly/collection.js
Last synced: 3 months ago
JSON representation
Collection class that has Lo-Dash/Underscore collection methods in the prototype
- Host: GitHub
- URL: https://github.com/bttmly/collection.js
- Owner: bttmly
- License: mit
- Created: 2014-02-11T04:22:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-22T03:13:15.000Z (over 10 years ago)
- Last Synced: 2025-01-08T22:02:07.652Z (4 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 426 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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][].
[forEach]: http://lodash.com/docs#forEach
[each]: http://lodash.com/docs#each
[eachRight]: http://lodash.com/docs#eachRight
[forEachRight]: http://lodash.com/docs#forEachRight
[map]: http://lodash.com/docs#map
[collect]: http://lodash.com/docs#collect
[filter]: http://lodash.com/docs#filter
[select]: http://lodash.com/docs#select
[where]: http://lodash.com/docs#where
[pluck]: http://lodash.com/docs#pluck
[reject]: http://lodash.com/docs#reject
[invoke]: http://lodash.com/docs#invoke
[initial]: http://lodash.com/docs#initial
[rest]: http://lodash.com/docs#rest
[tail]: http://lodash.com/docs#tail
[drop]: http://lodash.com/docs#drop
[compact]: http://lodash.com/docs#compact
[flatten]: http://lodash.com/docs#flatten
[without]: http://lodash.com/docs#without
[shuffle]: http://lodash.com/docs#shuffle
[remove]: http://lodash.com/docs#remove
[transform]: http://lodash.com/docs#transform
[unique]: http://lodash.com/docs#unique
[uniq]: http://lodash.com/docs#uniq
[union]: http://lodash.com/docs#union
[intersection]: http://lodash.com/docs#intersection
[difference]: http://lodash.com/docs#difference[reduce]: http://lodash.com/docs#reduce
[foldl]: http://lodash.com/docs#foldl
[inject]: http://lodash.com/docs#inject
[reduceRight]: http://lodash.com/docs#reduceRight
[foldr]: http://lodash.com/docs#foldr
[find]: http://lodash.com/docs#find
[detect]: http://lodash.com/docs#detect
[findWhere]: http://lodash.com/docs#findWhere
[every]: http://lodash.com/docs#every
[all]: http://lodash.com/docs#all
[some]: http://lodash.com/docs#some
[any]: http://lodash.com/docs#any
[contains]: http://lodash.com/docs#contains
[max]: http://lodash.com/docs#max
[min]: http://lodash.com/docs#min
[include]: http://lodash.com/docs#include
[size]: http://lodash.com/docs#size
[first]: http://lodash.com/docs#first
[last]: http://lodash.com/docs#last
[indexOf]: http://lodash.com/docs#indexOf
[lastIndexOf]: http://lodash.com/docs#lastIndexOf
[isEmpty]: http://lodash.com/docs#isEmpty
[toArray]: http://lodash.com/docs#toArray
[at]: http://lodash.com/docs#at
[findLast]: http://lodash.com/docs#findLast
[indexBy]: http://lodash.com/docs#indexBy
[sortBy]: http://lodash.com/docs#sortBy
[countBy]: http://lodash.com/docs#countBy