Yield a new iterable sequence that applies the mapper to every item in the original
function map(mapper) {
    return function* (iterable) {
        let index = 0;
        for (const value of iterable) {
            yield mapper(value, index);
            index = index + 1;
        }
    };
}