1.0.5 • Published 7 years ago

ck-stack v1.0.5

Weekly downloads
20
License
MIT
Repository
github
Last release
7 years ago

Stack

An ES6 implementation of a stack

Usage

$ npm install ck-stack --save
import stack from 'ck-stack';

const s = stack()
<script type='text/javascript' src='/dist/ck-stack.js'></script>
<script type='text/javascript' src='/dist/ck-stack.min.js'></script>

const s = Stack()
s.push(1)
s.push(2)
s.push(3)

s.getValues()
// => [1, 2, 3]   - this is a copy of the stack array

s.isEmpty()
// => false

s.current()
// => 3

s.pop()
// => 3

s.current()
// => 2

s.clear()
s.getValues
// => []

s.isEmpty()
// => true

Tests

$ npm run test

License

MIT - see LICENSE.md

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago