https://github.com/Gozala/reducers
Raw File
Tip revision: 2a5706e16ddbd76deabdd176b570f97984b6f153 authored by Irakli Gozalishvili on 10 November 2012, 06:03:09 UTC
Version 1.0.2
Tip revision: 2a5706e
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