Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

util-pusher-x

Xotic7504.4kMIT1.0.3

A simple pusher/concatenator utility.

util, pusher, concatenator, module, javascript, nodejs, browser

readme

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

util-pusher-x

This pushes or concatenates into a new or existing array.

module.exports(arrayLike, [from], [target])

This pushes or concatenates into a new or existing array.

Kind: Exported member

Param Type Description
arrayLike ArrayLike The source.
[from] number The from source index.
[target] Array The target array.

Example

import pusher from 'util-pusher-x';

const x = [1, 2, 3];
console.log(pusher([4, 5, 6], 1, x)); // [1, 2, 3, 5, 6]