Skip to content
Myr

Defaulting Collection#join() to ""

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

authored by visionmedia · committed by visionmedia · parent 6c7e0fd · Browse files · 2 files+4 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

2 files+4 added−4 removed

  • tests:+2 added−2 removed
  • other:+2 added−2 removed

2 files+4 added−4 removed

modified:lib/express/collection.js+2 added-2 removed
99 unmodified lines
100 return this101 },102 103 /**104 * Join a collection with the given _str_ or ", ".104 * Join a collection with the given _str_ or ''.105 *106 * @param {string} str107 * @return {string}108 * @api public109 */110 111 join: function(str) {112 return this.toArray().join(str || ', ')112 return this.toArray().join(str || '')113 },114 115 /**116 * Iterate with _memo_ using callback _fn_.
392 unmodified lines
modified:spec/spec.collection.js+2 added-2 removed
382 unmodified lines
383 end384 end385 386 describe '#join()'387 it 'should join a collection with ", " by default'388 $([1,2,3]).join().should.eql '1, 2, 3'387 it 'should join a collection with "" by default'388 $([1,2,3]).join().should.eql '123'389 end390 391 it 'should join with an arbitrary string'392 $([1,2,3]).join(' ').should.eql '1 2 3'
23 unmodified lines