JSFiddle - React, Tailwind, and code Playground

JavaScript

function sequence(start, step) {
    start = start || 0;
    step = step || 1;

    var counter = 0;
    return function() {
        return start + step * counter++;
    }
}