Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit e5e24bd33f348f89bedc76b2b650a2b4c5a0a024 1 parent 789ad4f
@flesler flesler authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/core.js
View
10 src/core.js
@@ -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 );
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.