src/Iterator.js
function BinarySearchTreeIterator(tree, type) {
    type = type || 'v';

    if (type !== 'k' && type !== 'v' && type !== 'e') {
        throw new Error('Incorrect binary search tree iterator type "' + type + '"!');
    }

    this._type = type;
    this._tree = tree;
    this._last = null;
    this._done = false;
}
function BinarySearchTreeIterator(tree, type) {
    type = type || 'v';

    if (type !== 'k' && type !== 'v' && type !== 'e') {
        throw new Error('Incorrect binary search tree iterator type "' + type + '"!');
    }

    this._type = type;
    this._tree = tree;
    this._last = null;
    this._done = false;
}
Binary search tree iterator

@param tree Binary Search tree
@param type Type of iteration result
@constructor