stack-simple

1.0.6 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i stack-simple

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

2.01 kB

Total Files

4

Last publish

Collaborators

  • arkadyryabinin