Skip to content

Instantly share code, notes, and snippets.

@rao123dk
Created June 5, 2018 05:31
Show Gist options
  • Save rao123dk/7e426f8ad7c4953c387feffde893c757 to your computer and use it in GitHub Desktop.
Save rao123dk/7e426f8ad7c4953c387feffde893c757 to your computer and use it in GitHub Desktop.
The code will generate an array of one thousand objects with the properties.
function userProfiler(howMuch){
return new Array(howMuch).fill().map((data,i)=>{
return {
'id' : i,
'name' : 'dummyUser'+i,
'Mobile' : Math.floor(Math.random() * 9000000000) + 1000000000,
'age' : Math.floor(Math.random() * (100-10 + 10) + 1)
}
});
}
console.log(userProfiler(100));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment