Loading ...
Sorry, an error occurred while loading the content.

Array Extras

Expand Messages
  • Garrett Smith
    Why doesn t YUI use Array Extras? It should. Array Extras is standard. Array.forEach could nearly replace the Dom batch function in many cases (batch is like
    Message 1 of 1 , Feb 28, 2007
    • 0 Attachment

      Why doesn't YUI use Array Extras?

       

      It should.

       

      Array Extras is standard.

       

      Array.forEach could nearly replace the Dom batch function in many cases (batch is like the standard forEach).

       

      This would also have a small performance boost for browsers which support Array Extras natively.

       

      YUI should provide support for browsers which don't support Array Extras, both on the prototype and on the Global Array object as a static method (with the arrayLikeObject as the first argument to each Array Extra method).

       

      if( !Array.prototype.forEach ) {

       

      }

       

      if( !Array.forEach ) {

       

      }

       

      // et c.

      http://developer.mozilla.org/en/docs/Talk:Core_JavaScript_1.5_Reference:Global_Objects:Array

       

      In addition, it would also be nice to have a collections API, with Set, ListIterator, et c, and decent binary search methods; although that is a different topic altogether.

       

       

       

       

    Your message has been successfully submitted and would be delivered to recipients shortly.