https://github.com/Gozala/reducers
Revision 4e743321440a426d44c6ce03c05339e73c4517a5 authored by Irakli Gozalishvili on 24 October 2012, 19:47:47 UTC, committed by Irakli Gozalishvili on 24 October 2012, 19:47:47 UTC
1 parent c393dc3
Raw File
Tip revision: 4e743321440a426d44c6ce03c05339e73c4517a5 authored by Irakli Gozalishvili on 24 October 2012, 19:47:47 UTC
Version 0.1.2
Tip revision: 4e74332
into.js
/* vim:set ts=2 sw=2 sts=2 expandtab */
/*jshint asi: true undef: true es5: true node: true browser: true devel: true
         forin: true latedef: false globalstrict: true */

"use strict";

var reduce = require("./reduce")

function into(source, buffer) {
  /**
  Adds items of given `reducible` into
  given `array` or a new empty one if omitted.
  **/
  return reduce(source, function(result, value) {
    result.push(value)
    return result
  }, buffer || [])
}

module.exports = into
back to top