Something went wrong. Try again.
Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
Something went wrong. Try again.
529 B · 13 lines
JavaScript
at main
1234567891011121314// create a function that will take in a number of times to be run and a function that will produce an entry/entityexport const makeEntries = (amount, makeEntry) => { // create array of entries to be outputted const entries = []; // iterate from 0 up to the amount inputted for (let i = 0; i < amount; i += 1) { // each iteration, create an entry and pass it the current index & push it into output array const entry = makeEntry(i); entries.push(entry); } // return array of entries return entries;};