jquery core: enhancements to jquery.map, closes #2803
This commit is contained in:
parent
789ad4f769
commit
e5e24bd33f
10
src/core.js
10
src/core.js
|
@ -1194,15 +1194,11 @@ jQuery.extend({
|
||||||
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
||||||
var value = callback( elems[ i ], i );
|
var value = callback( elems[ i ], i );
|
||||||
|
|
||||||
if ( value !== null && value != undefined ) {
|
if ( value != null )
|
||||||
if ( value.constructor != Array )
|
ret[ ret.length ] = value;
|
||||||
value = [ value ];
|
|
||||||
|
|
||||||
ret = ret.concat( value );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret.concat.apply( [], ret );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue