Added $(...).map() functionality. (Also closes #1250, imo)
[jquery.git] / src / jquery / jquery.js
index 8988c5e..8180a4e 100644 (file)
@@ -1189,6 +1189,12 @@ jQuery.fn = jQuery.prototype = {
        slice: function() {
                return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
        },
+
+       map: function(fn){
+               return this.pushStack(jQuery.map( this, function(elem,i){
+                       return fn.call( elem, i, elem );
+               }));
+       },
        
        /**
         * @private