.clone()
→ Collection<K, V>
client.users.clone();Class
Extended Map with utility methods for key-value collections.
Extends Map
new Collection()| Name | Type | Description |
|---|---|---|
| cacheread-only | this |
→ Collection<K, V>
client.users.clone();collections: ReadonlyCollection<K, V>[] → Collection<K, V>
client.users.concat(collections);fn: (value: V, key: K, collection: this) => void → this
Iterate without allocating; returns this for chaining.
client.users.each(fn);fn: (value: V, key: K) => boolean → boolean
client.users.every(fn);fn: (value: V, key: K) => boolean → Collection<K, V>
client.users.filter(fn);fn: (value: V, key: K) => boolean → V | undefined
client.users.find(fn);fn: (value: V, key: K) => boolean → K | undefined
client.users.findKey(fn);→ V | undefined
amount: number → V[]
First value, or the first amount values.
client.users.first();→ V | undefined
amount: number → V[]
Last value, or the last amount values (no full-array alloc for a single item).
client.users.last();fn: (value: V, key: K) => T → T[]
client.users.map(fn);fn: (value: V, key: K) => boolean → [Collection<K, V>, Collection<K, V>]
client.users.partition(fn);→ V | undefined
amount: number → V[]
One random value, or amount unique random values.
client.users.random();fn: (acc: T, value: V, key: K) => T, initialValue: T → T
client.users.reduce(fn, initialValue);fn: (value: V, key: K) => boolean → boolean
client.users.some(fn);compareFn?: (a: V, b: V, aKey: K, bKey: K) => number → this
client.users.sort();fn: (collection: this) => void → this
client.users.tap(fn);→ string
client.users.toString();