lib/tools.js
function toArray(iterable) {
    // kinda optimisations
    if (isArray(iterable)) {
        return iterable.slice();
    }
    if (typeof iterable === 'string') {
        return iterable.split('');
    }

    var iter = ensureIter(iterable);
    var result = [];
    var next = iter.next();
    while (!next.done) {
        result.push(next.value);
        next = iter.next();
    }
    return result;
}
function toArray(iterable) {
    // kinda optimisations
    if (isArray(iterable)) {
        return iterable.slice();
    }
    if (typeof iterable === 'string') {
        return iterable.split('');
    }

    var iter = ensureIter(iterable);
    var result = [];
    var next = iter.next();
    while (!next.done) {
        result.push(next.value);
        next = iter.next();
    }
    return result;
}
function toArray ( iterable ) { // kinda optimisations if ( isArray ( iterable ) ) { return iterable . slice ( ) ; } if ( typeof iterable === 'string' ) { return iterable . split ( '' ) ; } var iter = ensureIter ( iterable ) ; var result = [ ] ; var next = iter . next ( ) ; while ( ! next . done ) { result . push ( next . value ) ; next = iter . next ( ) ; } return result ; }
Unrolls passed iterable producing new array.
@param {Iterable|Iterator|Array|String} iterable
@returns Array
Unrolls passed iterable producing new array .