-
Notifications
You must be signed in to change notification settings - Fork 0
a2d.Collection
Armen edited this page Apr 29, 2012
·
14 revisions
Implements an array-like collection
Defined in collection.js
| a2d.Collection() |
| **[append](#append)** (other) Append the contents of another collection to this one. | |
| _number_ | **[indexOf](#indexOf)** (item) Get the index of the given item in the collection |
| _any_ | **[pop](#pop)** Remove item from the end of the collection and return it. |
| **[push](#push)** (item) Add an item to the end of the collection | |
| _any_ | **[remove](#remove)** (idx) Remove item at given index |
| _any_ | **[shift](#shift)** Remove the first item from the collection and return it. |
| **[unshift](#unshift)** (item) Add an item to the beginning of this collection |
| **[length](#length)** length of the collection |
a2d.Collection()
append (other)
Append the contents of another collection to this one.
{a2d.Collection} other
--
{number} indexOf (item)
Get the index of the given item in the collection
{any} item
{number}
the index
--
{any} pop
Remove item from the end of the collection
and return it.
{any}
the removed item
--
push (item)
Add an item to the end of the collection
{any} item
--
{any} remove (idx)
Remove item at given index
{number} idx
{any}
the removed item
--
{any} shift
Remove the first item from the collection and return it.
{any}
the removed item
--
unshift (item)
Add an item to the beginning of this collection
{any} item
the new length of the collection
length
length of the collection