stack-ll

    1.0.1 • Public • Published

    stack

    simple last-in-first-out(LIFO) data structure

    Build Status

    Usage

    Example

      var Stack = require('stack-ll')
      var s = new Stack()
      s.push('hello')
      s.push('world')
      console.log(s.pop())
      console.log(s.pop())

    API

    stack = new Stack()

    Creates a new stack object

    stack.push(val)

    pushes val into stack object

    stack.pop()

    removes top of stack element and return its value

    stack.length

    returns length of the stack

    stack.forEach(callback(val))

    Iterate over each value of stack using callback

    License

    MIT

    Install

    npm i stack-ll

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar