A glance at the Lo-Dash docs shows that the API falls in to categories of:
- Arrays,
- Chaining,
- Collections,
- Functions,
- Objects,
- Utilities,
- Methods,
- and Properties
A more detailed look in to the Arrays API shows approximately 30 different methods available that are applicable to arrays.
The Collections API has a few more methods than the Arrays API, and they do not share the same methods.
Within the Collections API, a collection is described as an object that is iterated, and may be an array:
collection (Array|Object|string): The collection to iterate over.
Also, interestingly, there's a Collections API method _.toArray
that returns an array from a collection:
Arguments
collection (Array|Object|string): The collection to convert. Returns
(Array): Returns the new converted array.
Would anyone happen to know a formal difference between an array and collection in the Lo-Dash API? I was under the presumption it was a difference due to Backbone.js, however, am now questioning my reasoning to that end, since the methods may be available elsewhere. Thanks in advance.