1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    21
    Vote Rating
    0
    Gonfi is on a distinguished road

      0  

    Default Array functions

    Array functions


    clarification:
    old: Removes the specified object from the array.
    new: Removes THE FIRST OCCURRENCE OF the specified object from the array.

    also i dislike the signature of the method, but assume it's out of question to change that. (would prefer the return value to be either the removed object, or pos where -1 = none, or boolean).

    also i would like to have additional methods 3:
    • removeAll(obj)
    • Code:
      Array.prototype.removeRange = function(from, to) {
        var rest = this.slice((to || from) + 1 || this.length);
        this.length = from < 0 ? this.length + from : from;
        return this.push.apply(this, rest);
      };
    • with an alias for removePos to make it clear how to call it with just one param.
    ( Array Remove - By John Resig (MIT Licensed) http://ejohn.org/blog/javascript-array-remove/ )
    Last edited by mystix; 20 Jul 2009 at 5:55 AM. Reason: POST CODE IN [code][/code] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code

  2. #2
    Ext User
    Join Date
    Jun 2009
    Posts
    21
    Vote Rating
    0
    Gonfi is on a distinguished road

      0  

    Default follow-up

    follow-up


    (and that it re-indexes the tail of the array)

  3. #3
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Moved your posts from Documentation Bugs thread to General Discussion forum.

Thread Participants: 1