implode.js 201 B

123456789
  1. 'use strict';
  2. module.exports = function implode(key, glue) {
  3. if (glue === undefined) {
  4. return this.items.join(key);
  5. }
  6. return new this.constructor(this.items).pluck(key).all().join(glue);
  7. };