https://github.com/Gozala/reducers
Raw File
Tip revision: 8f5e9421310e145fd1bae3d987811295f835fdfb authored by Irakli Gozalishvili on 03 November 2012, 00:04:23 UTC
Make current release a v1.0.0
Tip revision: 8f5e942
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