linkedlist-javascript-simple
v1.0.2
Published
Linked List Lib Javascript
Downloads
2
Readme
Linked List Library for Javascript
Linked List Library with some array methods for Javascript
npm i linkedlist-javascript-simple
Method Status
- [x] Active
- [ ] ToDo
Adding Methods
- [x] unshift(val)
- [x] push(val)
- [x] insertAt(index, val)
Remove Methods
- [x] shift()
- [x] remove(val)
- [x] pop()
Search Methods
- [x] find(val)
- [ ] last()
Sorting Methods
- [x] reverse()
- [ ] ascending()
- [ ] descending()
Utils
- [x] join(brace)
Iteration Methods
- [ ] every()
- [ ] forEach()
- [ ] map()
Example Usage
var LinkedList = require('linkedlist-javascript-simple');
var list = new LinkedList.List();
list.push(2);
list.push(3);
list.push(5);
list.push(5);
list.push(7);
list.unshift(1);
list.insertAt(6, 8);
list.insertAt(7, 8);
list.unshift(1);
list.pop();
list.shift();
list.insertAt(8, 10);
list.remove(10);
list.reverse();
console.log(list.join(","));
Output: "8,7,5,5,3,2,1"