Skip to content
Myr

Added Collection#toArray()

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

authored by visionmedia · committed by visionmedia · parent 933baf9 · Browse files · 2 files+20 added−0 removed
This commit

State

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

Diff stats

2 files+20 added−0 removed

  • tests:+6 added−0 removed
  • other:+14 added−0 removed

2 files+20 added−0 removed

modified:lib/express/collection.js+14 added
231 unmodified lines
232 return $(this.reduce([], function(array, val, key){233 array.push(key)234 return array235 }))236 },237 238 /**239 * Convert a collection to a true array.240 *241 * @return {array}242 * @api public243 */244 245 toArray: function() {246 return this.reduce([], function(array, val){247 array.push(val)248 return array249 })250 }251})252253/**
11 unmodified lines
modified:spec/spec.collection.js+6 added