stack-ll
v1.0.1
Published
simple last-in-first-out(LIFO) data structure
Downloads
1
Maintainers
Readme
stack
simple last-in-first-out(LIFO) data structure
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