https://github.com/Gozala/reducers
Raw File
Tip revision: 4b5432a40fc01ed434431fbd874bcc259106e497 authored by Irakli Gozalishvili on 07 November 2012, 06:34:53 UTC
Version 1.0.1
Tip revision: 4b5432a
into.js
"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 reduceInto(result, value) {
    result.push(value)
    return result
  }, buffer || [])
}

module.exports = into
back to top