1.0.1 • Published 7 years ago

stack-ll v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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