Skip to content
Myr

Refactored Collection#keys() with #map()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 95e9e3d · Browse files · 1 file+3 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−4 removed

  • other:+3 added−4 removed

1 file+3 added−4 removed

modified:lib/express/collection.js+3 added-4 removed
254 unmodified lines
255 * @api public256 */257 258 keys: function() {259 return $(this.reduce([], function(array, val, key){260 array.push(key)261 return array262 }))259 return this.map(function(val, key){260 return key261 })262 },263 264 /**265 * Convert a collection to a true array.
158 unmodified lines