« first day (1010 days earlier)      last day (3107 days later) » 

02:56
Shit
 
2 hours later…
04:39
function* range(start, end) {
let current = start;

while (current <= end) {
yield current++;
}
}

function product(input) {
let result = 1;

for (let next of input)
result = result * next;

return result;
}


let fac = n => product(range(1, n));

« first day (1010 days earlier)      last day (3107 days later) »