Skip to main content
Module

x/rambda/source/insert.js

Faster and smaller alternative to Ramda
Latest
File
import { curry } from './curry.js'
export function insertFn(indexToInsert, valueToInsert, array) { return [ ...array.slice(0, indexToInsert), valueToInsert, ...array.slice(indexToInsert), ]}
export const insert = curry(insertFn)