Quick optimization - Pulled the if instanceof Array out of the loop:

Array.prototype.lastIndexOf = function(obj) {
        var a = this.length;
        if (!(this[a] instanceof Array)) {
                while (--a -(-1)) {
                        if (this[a] == obj) return a;                   
                }
        } else {                
                 while (--a -(-1)) {
                        if (this[a].eql(obj)) return a;         
                }
        }
        return undefined;
};


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to