Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function randomIntInc(low, high) {
return Math.floor(Math.random() * (high - low + 1) + low);
}
function createUsers(low, high) {
let items = {};
const generatedItems = randomIntInc(low, high);
for (let i = 0; i < generatedItems; i++) {
const item = {}
item.uid = chance.guid();
/* extra fields generated by chance */
const parent = {}
parent[item.uid] = item
Object.assign(items, parent)
}
return items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment