1.0.6 • Published 5 years ago
stack-simple v1.0.6
Stack data structure implementation
Usage
const LIFO = require('stack-simple');
const stack = new LIFO(); // creates a stack object
stack.push(node); // appends a node to stack
stack.pop(node); // removes a node from stack and returns its value
Examples
const LIFO = require('stack-simple');
const stack = new LIFO();
stack.push([7, 8]);
stack.push(99);
stack.push('good');
stack.push('night');
stack.pop(); // 'night'
stack.pop(); // 'good'
stack.pop(); // 99
stack.pop(); // [7, 8]
Install
$ npm install stack-simple
License
ISC