Status of Array extras in ECMA 4
David Golightly
davigoli at gmail.com
Sat Sep 1 10:07:12 PDT 2007
I'm curious as to the fate of the famous JavaScript 1.6 Array extras
(indexOf, lastIndexOf, forEach, map, filter, every, some) in ECMAScript 4.
As a JavaScript developer, I've come to greatly appreciate the
functional-style flexibility these methods offer, and have incorporated
implementations of them into my everyday JS toolkit. (See:
http://developer.mozilla.org/en/docs/New_in_JavaScript_1.6#Array_extras and
http://www.webreference.com/programming/javascript/ncz/column4/index.html if
you're not familiar with the Array extras.)
However, according to the current ECMAScript 4 specification, these methods
appear to be missing from Array.prototype:
http://developer.mozilla.org/es4/spec/chapter_19_native_objects.html#array_objects
Given the significant performance boost from moving this sort of iteration
into machine code from interpreted code, I for one would greatly appreciate
an official endorsement of these methods in ECMAScript 4. They certainly
seem to fit within the spirit of the existing ECMAScript 3 native array
methods (slice, splice, etc.) and have parallels in the String prototype
(indexOf, lastIndexOf). Is there a reason not to include them in ECMA 4?
If so, what might that be?
Thanks,
David Golightly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20070901/3eba2d78/attachment-0002.html
More information about the Es4-discuss
mailing list