iterator.js
function Iterator(iterator) {

    if (Array.isArray(iterator) || typeof iterator == "string")
        return Iterator.iterate(iterator);

    iterator = Object(iterator);

    if (!(this instanceof Iterator))
        return new Iterator(iterator);

    this.next = this.send =
        iterator.send || iterator.next || iterator;

    if (
        Object.prototype.toString.call(this.next) !=
        "[object Function]"
    )
        throw new TypeError();

}
function Iterator(iterator) {

    if (Array.isArray(iterator) || typeof iterator == "string")
        return Iterator.iterate(iterator);

    iterator = Object(iterator);

    if (!(this instanceof Iterator))
        return new Iterator(iterator);

    this.next = this.send =
        iterator.send || iterator.next || iterator;

    if (
        Object.prototype.toString.call(this.next) !=
        "[object Function]"
    )
        throw new TypeError();

}
function Iterator ( iterator ) { if ( Array . isArray ( iterator ) || typeof iterator == "string" ) return Iterator . iterate ( iterator ) ; iterator = Object ( iterator ) ; if ( ! ( this instanceof Iterator ) ) return new Iterator ( iterator ) ; this . next = this . send = iterator . send || iterator . next || iterator ; if ( Object . prototype . toString . call ( this . next ) != "[object Function]" ) throw new TypeError ( ) ; }
upgrades an iterator to a Iterator
upgrades an iterator to a Iterator