Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

addin

1.0.0 • Public • Published

addin

Build Status Coverage Status

NPM

Add an element into an array without modifying the original one. Safe alternative for splice().

Installation

yarn add addin

Usage

Syntax

addin(array, index, item[, item2[, item3[, ...]]])
const addin = require('addin');
const arr = [1, 2, 3];
const newArr = addin(arr, 1, 10);
 
console.log(newArr); // [1, 10, 2, 3]
console.log(arr);    // [1, 2, 3] <-- Still the same

install

npm i addin

Downloadsweekly downloads

5

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability