@writetome51/array-append-prepend
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

prepend(value, array): void

Adds value to beginning of array. Alternative to array.unshift(value)

append(value, array): void

Adds value to end of array. Alternative to array.push(value)

Examples

let arr = [1, 2, 3];  
prepend(10, arr); 
// arr === [10, 1, 2, 3] 

arr = [1, 2, 3];
append(30, arr); 
// arr === [1, 2, 3, 30]

Installation

npm i @writetome51/array-append-prepend

Loading

import {prepend, append} from '@writetome51/array-append-prepend';

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @writetome51/array-append-prepend

      Weekly Downloads

      2

      Version

      4.0.0

      License

      MIT

      Unpacked Size

      2.68 kB

      Total Files

      5

      Last publish

      Collaborators

      • writetome51