Array data generator
function* genPeople(numberOfPeople) { let i = 0; while (i++ < numberOfPeople) { yield { name: `John ${i}`, surname: `Doe ${i}` }; } } Array.from(genPeople(20));