for copying arrays and/or converting iterables like 'arguments' to
arrays,
// arguments - array
newArray = Array.slice( arguments );
// copy a-b
copy = Array.slice( original );
--- provides a small increase in speed for a variety of array
operations contained in prototype
also for array
On 8/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
newArray = Array.slice( arguments );
Yeah, this is known to us for some time. I've spent some time getting rid of
all the $A calls internal to Prototype (they're everywhere!) and replacing
them with Array.prototype.slice calls, but I
On Aug 30, 2007, at 5:52 PM, Mislav Marohnić wrote:
On 8/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
also, for generating unique arrays:
function uniqueArray( array ){
var uniqueHash = {}, unique=[], i;
for( i=array.length; i--; ){
if( !uniqueHash[ a[i] ]){
On 8/31/07, Nicolás Sanguinetti [EMAIL PROTECTED] wrote:
As discussed in
http://redhanded.hobix.com/inspect/showingPerfectTime.html
String.prototype.replace with a callback is broken in Safari (at least
up until v2).
Ah yes, the Safari issue.
TAG, nice catch. I would have never thought of
Dan Webb's LowPro[1] solves this kind of issue by registering a
global Ajax.Responder that evaluates DOMContentReady behaviors
onComplete.
Thinking along similar lines, you could wrap Event.observe so that
observers set for contentloaded are also stored into a queue that gets
processed after
Not only that, but if the array contains objects, the toString()
method on the Object prototype will cause all but one object to be
removed from the array, because all objects without an overridden
toString() method report [object].
On Aug 30, 2007, at 5:50 PM, Tom Gregory wrote:
On Aug