image

Very cool!

Minor suggestion: instead of Array.from(new Array(n)) to get an array of n length filled with undefined, use Array.from({ length: n }).

If you also need to map over those values immediately, you can pass a callback which does this without creating an intermediate array between .from and .map:

Array.from({ length: 4 }, (value, index) => index) ? [0, 1, 2, 3].