void-list
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

void-list

Add Java Style List to Javascript

Instalation

npm install void-list

Example

// or import { List } from 'void-list'
const { List, ImmutableList } = require('void-list');

let list = new List();
list.add("Lazy");
list.add("Foxes");
list.add("Over");
list.add("Rainbow");
list.addAll('Not', 'J');

// Over
console.log(list.get(2));

// return the removed element
console.log(list.remove(2));

// Rainbow
console.log(list.get(2));

// shuffle the list
list.shuffle();
console.log(list.toString());

// get the index for Lazy
console.log(list.indexOf("Lazy"));

// create a list from an array
let l = List.fromArray(["Lazy", "Foxes", "Over", "Rainbow"]);

// non modifiable list
let immune = new ImmutableList(l);

/void-list/

    Package Sidebar

    Install

    npm i void-list

    Weekly Downloads

    2

    Version

    1.1.7

    License

    MIT

    Unpacked Size

    41.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • mrthomas20121