https://github.com/Gozala/reducers
Raw File
Tip revision: 21e1c7f62ba9af46955bc363cdfd88afa5984c01 authored by Irakli Gozalishvili on 26 October 2012, 06:37:14 UTC
Version 0.1.5
Tip revision: 21e1c7f
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(result, value) {
    result.push(value)
    return result
  }, buffer || [])
}

module.exports = into
back to top