Skip to content

Instantly share code, notes, and snippets.

@JamWils
Created June 8, 2017 19:02
Show Gist options
  • Save JamWils/8b432b28038e1c59c821448ff6ba6472 to your computer and use it in GitHub Desktop.
Save JamWils/8b432b28038e1c59c821448ff6ba6472 to your computer and use it in GitHub Desktop.
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