Share your code. Components are building blocks, you are the architect.

utils/insert
v1.1.0
1.1.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Inserts the supplied element into the list, at the specified `index`

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/insert in your project
npm i @bit/bit.ramda.utils.insert
Copied

insert (index:Number, elt:*, list:Array) : Array

Inserts the supplied element into the list, at the specified index. _Note that

this is not destructive_: it returns a copy of the list with the changes. <small>No lists have been harmed in the application of this function.</small>

Example

R.insert(2, 'x', [1,2,3,4]); //=> [1,2,'x',3,4]

Arguments

index: Number

The position to insert the element

elt: *

The element to insert into the Array

list: Array

The list to insert into

Returns

Array

A new Array with `elt` inserted at `index`.