mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fixed a bug with $.map() and undefined values.
This commit is contained in:
parent
0027439156
commit
4531ab1324
2
jquery/jquery.js
vendored
2
jquery/jquery.js
vendored
@ -751,7 +751,7 @@ jQuery.map = function(a,f) {
|
|||||||
var r = [];
|
var r = [];
|
||||||
for ( var i = 0; i < a.length; i++ ) {
|
for ( var i = 0; i < a.length; i++ ) {
|
||||||
var t = f(a[i],i);
|
var t = f(a[i],i);
|
||||||
if ( t !== null ) {
|
if ( t !== null && t != undefined ) {
|
||||||
if ( t.constructor != Array ) t = [t];
|
if ( t.constructor != Array ) t = [t];
|
||||||
r = jQuery.merge( t, r );
|
r = jQuery.merge( t, r );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user