a minimum heap!
install mocha -g
-
npm test
ormocha --compilers js:babel-register --recursive
It is important to note that .default
has to be referenced explicitly in order to obtain the class from the module. More info here.
var Heap = require("heap-it").default
var heap = new Heap()
heap.insert(14)
heap.insert(9)
heap.insert(11)
heap.insert(5)
console.log(heap.list)
// [ 0, 5, 9, 11, 14 ]