Identical to Map.clear(). Removes all elements from the collection.
Creates an identical shallow copy of this collection.
Identical to Map.delete(). Deletes an element from the collection.
The key to delete from the collection
true
if the element was removed, false
if the element does not exist.
Identical to Map.forEach(), but returns the collection instead of undefined.
Returns an iterable of key, value pairs for every entry in the map.
Checks if this collection shares identical items with another. This is different to checking for equality using equal-signs, because the collections may be different objects, but contain the same data.
Collection to compare with
Whether the collections have identical contents
Checks if all items passes a test. Identical in behavior to Array.every().
Function used to test (should return a boolean)
Identical to Array.filter(), but returns a Collection instead of an Array.
The function to test with (should return boolean)
Searches for a single item where the given function returns a truthy value. This behaves like
Array.find().
id
property, and if you want to find by id you
should use the get
method. See
MDN for details.
The function to test with (should return boolean)
Searches for the key of a single item where the given function returns a truthy value. This behaves like Array.findIndex(), but returns the key rather than the positional index.
The function to test with (should return boolean)
Obtains the first key(s) in this collection.
A single key if no amount is provided or an array of keys, starting from the end if amount is negative
Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to Array.flatMap().
Function that produces a new Collection
Identical to Map.has(). Checks if an element exists in the collection.
The key of the element to check for
true
if the element exists, false
if it does not exist.
Checks if all of the elements exist in the collection.
The keys of the elements to check for
true
if all of the elements exist, false
if at least one does not exist.
Checks if any of the elements exist in the collection.
The keys of the elements to check for
true
if any of the elements exist, false
if none exist.
Returns an iterable of keys in the map
Obtains the last key(s) in this collection.
A single key if no amount is provided or an array of keys, starting from the start if amount is negative
Maps each item to another value into an array. Identical in behavior to Array.map().
Function that produces an element of the new array, taking three arguments
Maps each item to another value into a collection. Identical in behavior to Array.map().
Function that produces an element of the new collection, taking three arguments
Partitions the collection into two collections where the first collection contains the items that passed and the second contains the items that failed.
Function used to test (should return a boolean)
Obtains unique random key(s) from this collection.
A single key if no amount is provided or an array
Applies a function to produce a single value. Identical in behavior to Array.reduce().
Function used to reduce, taking four arguments; accumulator
, currentValue
, currentKey
,
and collection
Checks if there exists an item that passes a test. Identical in behavior to Array.some().
Function used to test (should return a boolean)
Removes items that satisfy the provided filter function.
Function used to test (should return a boolean)
The number of removed entries
Returns an iterable of values in the map
Generated using TypeDoc
Returns an iterable of entries in the map.