Skip to content

Instantly share code, notes, and snippets.

/* Typescript conversion of Ben Nadel's Collection class.
Based on the fact that subclassing Array directly does not work very well,
at least in Ecmascript versions < 6. Instead, this is based on creating a
collection from an array, where the actual methods are added to the array
after creation.
It works exactly like an array, while at the same time having additional
functionality.
*/