0.1.0 • Published 9 years ago
avkrash-stack v0.1.0
JS Test Task #3: Stack (avkrash-stack) 
Stack is dynamical data structure add-on to JS that allows you to create stacks and work with them.
Module description
Initializing the list
const Stack = require('avkrash-stack');
var stack = new Stack();Adding elements to the stack
stack.push(15);
stack.push({'foo':1,'bar':'tender'});See top element of stack
stack.peek(); //returns '15'
stack.peek(); //returns '15'Take top element from stack and show it value
stack.pop(); //returns '15' and removes top element
stack.peek(); //returns "{'foo':1,'bar':'tender'}"
stack.pop(); //returns "{'foo':1,'bar':'tender'}" and removes last element from stackCheck if stack is empty
stack.isEmprty(); //returns 'true'Getting started
Install
npm install avkrash-stackRunning tests
npm testP.S.: for additional info see JSDocs
0.1.0
9 years ago