dist/heap-js.umd.js
/**
         * Heap instance constructor.
         * @param  {Function} compare Optional comparison function, defaults to Heap.minComparator<number>
         */
Heap instance constructor.
@param  {Function} compare Optional comparison function, defaults to Heap.minComparator
Heap instance constructor . @param { Function } compare Optional comparison function defaults to Heap . minComparator
function Heap(compare) {
            var _this = this;
            if (compare === void 0) { compare = Heap.minComparator; }
            this.compare = compare;
            this.heapArray = [];
            this._limit = 0;
            this.offer = this.add;
            this.element = this.peek;
            this.poll = this.pop;
            this._invertedCompare = function (a, b) {
                return -1 * _this.compare(a, b);
            };
        }
function Heap ( compare ) { var _this = this ; if ( compare === void 0 ) { compare = Heap . minComparator ; } this . compare = compare ; this . heapArray = [ ] ; this . _limit = 0 ; this . offer = this . add ; this . element = this . peek ; this . poll = this . pop ; this . _invertedCompare = function ( a , b ) { return - 1 * _this . compare ( a , b ) ; } ; }
Heap instance constructor.
Heap instance constructor .
/**
             * Alias of add
             */ /**
             * Alias of peek
             */ /**
             * Alias of pop
             */ /**
             * Returns the inverse to the comparison function.
             * @return {Function}
             */