> Quick optimization - Pulled the if instanceof Array out of the loop:
And again:
// Returns the index of the first object in Array such that the object
== obj.
// Returns undefined if no match is found
Array.prototype.index = 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