This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --- | |
Write a function fromTo that produces a generator, that will produce values in a range. | |
Source: https://buttondown.email/cassidoo/archive/if-everything-was-perfect-you-would-never-learn/ | |
*/ | |
function fromTo(start, end) { | |
let value = start | |
return function () { | |
if (value <= end) { | |
return value++ |