Socket
Socket
Sign inDemoInstall

@woftis/linked-list

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @woftis/linked-list

A JS implementation of linked lists


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Linked List

Methods

MethodsDescription
sizeReturn the current list size
headReturn the current head object
tailReturn the tail (last) object
toStringReturn list of objects as a string in format ( value ) -> ( value ) -> ( value ) -> null
at(index)Return the object at a given index of the list
appendNode(value)Add a new item at the end of the list. Accepts the value of the node you want to add
prependNode(value)Add a new item at the start of the list (replacing the head). Accepts the value of the node you want to add
popRemove the last item from the list
contains(value)Returns true if the list contains the passed value, else returns false
find(value)Returns the index number of the value if the list contains the passed value, else returns null
insertAt(index, value)Adds value to the specified index position of the list. If 0 is provided, it will prepend to the head, if index is greater than list size it will append to the tail
removeAt(index)Removes value from the specified index position of the list. If 0 is provided, it will remove the head, if index is greater than list size it will return null

FAQs

Last updated on 08 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc