@extra-array/splice
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Removes or replaces existing values. 📦 😺 🏃 📼 🌔 📜 📰 📘

Alternatives: splice, splice$.

This is part of package extra-array.


array.splice(x, i, [n], ...vs);
// x:  an array
// i:  remove index
// n:  number of values to remove (rest)
// vs: values to insert
const array = require("extra-array");

var x = [1, 2, 3, 4, 5];
array.splice(x, 2);
// [ 1, 2 ]

array.splice(x, 2, 2);
// [ 1, 2, 5 ]

array.splice(x, 2, 2, 30, 40);
// [ 1, 2, 30, 40, 5 ]


References

/@extra-array/splice/

    Package Sidebar

    Install

    npm i @extra-array/splice

    Weekly Downloads

    396

    Version

    2.10.19

    License

    MIT

    Unpacked Size

    4.23 kB

    Total Files

    8

    Last publish

    Collaborators

    • wolfram77