Socket
Book a DemoInstallSign in
Socket

avkrash-stack

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avkrash-stack

Dynamical data structure - Stack

0.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

JS Test Task #3: Stack (avkrash-stack) Build Status

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 stack

Check if stack is empty

stack.isEmprty(); //returns 'true'

Getting started

Install

npm install avkrash-stack

Running tests

npm test

P.S.: for additional info see JSDocs

Keywords

stack

FAQs

Package last updated on 04 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.