map method ... and concat.apply

map method ... and concat.apply


Hello.
I don't think it requires a ticket, because I guess it is only some
"dust to remove" and nothing else.
I have spotted an interesting line inside jQuery 1.2.6 map method:
return ret.concat.apply( [], ret );
Since map seems to be widely used, I wonder if
return ret
is everything we need at the end of that method, that revisited in a
quick and "less chars" version could be something like:
map: function( elems, callback ) {
for( var ret = [], i = 0, length = elems.length, value; i <
length; value = callback( elems[ i ], i++ ) )
if( value != null )
ret[ ret.length ] = value;
return ret;
}
Kind Regards