An extension to native Array which supports direct element lookup by position index or primary key. Objects returned by IndexedArray are Array-like, meaning they have a .length property and are instanceof Array.

The IndexedArray constructor takes an optional existing Array and an optional indexer, which can be either the name of the property to index or a function like you would pass to Array.prototype.map. By default, MongoDB style _id is used.