Object

The native JavaScript object, with some additional constructor methods shimmed.

Methods

set(key, value)

Sets the value for a given key.

values()

Returns an array of the values of this map.

addEach(values|map)

Copies values or entries from another collection into this collection, and then returns this.

clear()

Deletes all of the values in the collection.

forEach(callback, thisp?)

Calls the callback for each entry in the collection.

map(callback, thisp?)

Returns an array of the respective return values of a callback for each entry in this collection.

concat(...iterables)

Returns a new collection of the same type containing all the values of itself and the values of any number of other iterable collections in order.

equals(value, equals?)

Returns whether this collection is equivalent to the given collection.

compare(value, compare?)

Compares two values and returns a number having the same relative value to zero.

hash(value)

Consistently returns the same string for the same object.

Usage

require("collections/shim-object");
  • Object
Source code