Sorted arrays

Xavier MONTILLET xavierm02.net at gmail.com
Fri Dec 30 06:46:11 PST 2011


Hi,

I think it would be useful to have sort store somewhere in the array
how it was sorted if it was and a new method append that would insert
an item so that the array is still sorted.

Here's how it could be implemented in ES 5 (you would use
Object.defineProperty to make methods non enumerable):
http://jsfiddle.net/xavierm02/exwtg/


More information about the es-discuss mailing list