constructor(obj, isIteratorFunction=false) {
        let iterable;
        let iterator;
        if (obj instanceof Seq) {
            // Avoid double-wrapping.
            iterable = obj._iterable;
            iterator = obj[Symbol.iterator];
        } else if (isIteratorFunction) {
            iterable = {[Symbol.iterator]: obj};
            iterator = obj;
        } else {
            if (!isIterable(obj)) {
                throw new Error(`Not iterable: ${obj}`);
            }
            iterable = obj;
            iterator = obj[Symbol.iterator].bind(obj);
        }

        /**
         * The generator, array, or other iterable object wrapped by this Seq instance.
         * @type {!(T[])|!Iterable.<T>|*}
         * @template T
         */
        this._iterable = iterable;

        /**
         * Iterates over the sequence's items.
         * @returns {!Iterator.<T>}
         * @template T
         */
        this[Symbol.iterator] = iterator;
    }
Wraps the given array, collection, or other iterable.
Use fromGenerator for wrapping generator functions.

@param {!(T[])|!Seq.<T>|!Iterable.<T>|*} obj
@param {!boolean=} isIteratorFunction
@template T