A collection class that extends the built-in Map class, providing additional utility methods for managing key-value pairs. K - The type of keys in the collection. V - The type of values in the collection.
Signature:
declare class Collection<K, V> extends Map<K, V>Extends: Map<K, V>
#Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Returns the value at the given index (supports negative indices from the end), or undefined if out of bounds. | ||
|
Returns whether every value in the collection satisfies the predicate. | ||
|
Filters the collection based on a provided predicate function, returning a new collection containing only the entries that satisfy the predicate. | ||
|
Retrieves the first value in the collection that satisfies the provided predicate function. | ||
|
Returns the first key in the collection whose value satisfies the predicate. | ||
|
Returns the first value in the collection, or undefined if the collection is empty. | ||
|
Returns the last value in the collection, or undefined if the collection is empty. | ||
|
Returns whether any value in the collection satisfies the predicate. |