Created
June 8, 2017 19:02
-
-
Save JamWils/8b432b28038e1c59c821448ff6ba6472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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