GenericOrder

An abstract collection that implements generic methods that can be used by any collection that keeps its values in a meaningful order.

Methods

toJSON()

Used by JSON.stringify to create a JSON representation of the collection.

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.

Usage

require("collections/shim-object");
var GenericOrder = require("collections/generic-order");
Object.addEach(MyOrder.prototype, GenericOrder.prototype);
  • GenericOrder
Source code