Commit 4531ab13 authored by John Resig's avatar John Resig

Fixed a bug with $.map() and undefined values.

parent 00274391
...@@ -751,7 +751,7 @@ jQuery.map = function(a,f) { ...@@ -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 );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment