Skip to content

JS-Void-Packages/void-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Add Java List to Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published