jquery core: enhancements to jquery.map, closes #2803

This commit is contained in:
Ariel Flesler 2008-05-06 14:54:53 +00:00
parent 789ad4f769
commit e5e24bd33f

View file

@ -1194,15 +1194,11 @@ jQuery.extend({
for ( var i = 0, length = elems.length; i < length; i++ ) {
var value = callback( elems[ i ], i );
if ( value !== null && value != undefined ) {
if ( value.constructor != Array )
value = [ value ];
ret = ret.concat( value );
}
if ( value != null )
ret[ ret.length ] = value;
}
return ret;
return ret.concat.apply( [], ret );
}
});