Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@jeremiah_tenbrink/doubly-linked-list

Doubly linked list.

readme

Welcome to doubly-linked-list 👋

Version Documentation Maintenance

A Doubly Linked list for javascript.

Documentation

Read documentation here.

Install

With Npm

`shell script npm install @jeremiah_tenbrink/doubly-linked-list


With Yarn

```shell script
yarn add @jeremiah_tenbrink/doubly-linked-list

Usage

Add to head

import {DoublyLinkedList} from '@jeremiah_tenbrink/doubly-linked-list';
const dll = DoublyLinkedList();

dll.addToHead("some value");

let dllSize = dll.getSize();
let value = dll.removeFromHead();
console.log(value);

dll.addToTail(45);
dll.addToTail(50);
value = dll.removeFromTail();
console.log(value);

dll.forEach(item => {
  console.log(item);
}).then(result => {
  console.log(result.complete);
}).catch(e => {
  console.log(e.message)
})

dll.forSome(item => {
  console.log(item);
  return true;
}).then(result => {
  console.log(result.complete) // should be false because true was returned in the forSome callback function
}).catch(e => {
  console.log(e.message)
})

Author

👤 Jeremiah Tenbrink

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator