/knit

Primary LanguageJavaScriptMIT LicenseMIT

knit

Insert an item between array elements

npm bundle size NPM

Insert an item between array elements

Installation

npm i @selrond/knit

Usage

Using ES Modules:

import { knit } from '@selrond/knit'

knit([1,2,3], '🎉') // [ 1, '🎉', 2, '🎉', 3 ]

Using CommonJS:

const { knit } = require('@selrond/knit')

knit([1,2,3], '🎉') // [ 1, '🎉', 2, '🎉', 3 ]