Home

# Library goog.structs

Function Summary
| `clear(?Object col)` Removes all the elements from the collection.
| `contains(?Object col, <Any Type> val) ⇒ boolean` Whether the collection contains the given value. This is O(n) and uses equals (==) to test the existence.
| `every(?Object col, ?Function f, ?Object= opt_obj) ⇒ boolean` Calls f for each value in a collection. If all calls return true this return true this returns true. If any returns false this returns false at this point and does not continue to check the remaining values.
| `filter(?Object col, ?Function f, ?Object= opt_obj) ⇒ !Object` Calls a function for every value in the collection. When a call returns true, adds the value to a new collection (Array is returned by default).
| `forEach(?Object col, ?Function f, ?Object= opt_obj)` Calls a function for each value in a collection. The function takes three arguments; the value, the key and the collection.
| `getCount(?Object col) ⇒ number` Returns the number of values in the collection-like object.
| `getKeys(?Object col) ⇒ (Array|undefined)` Returns the keys of the collection. Some collections have no notion of keys/indexes and this function will return undefined in those cases.
| `getValues(?Object col) ⇒ !Array` Returns the values of the collection-like object.
| `isEmpty(?Object col) ⇒ boolean` Whether the collection is empty.
| `map(?Object col, ?Function f, ?Object= opt_obj) ⇒ !Object` Calls a function for every value in the collection and adds the result into a new collection (defaults to creating a new Array).
| `some((Object|null|string) col, ?Function f, ?Object= opt_obj) ⇒ boolean` Calls f for each value in a collection. If any call returns true this returns true (without checking the rest). If all returns false this returns false.