Skip to content

Instantly share code, notes, and snippets.

Created September 15, 2021 15:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
faker.js addresses
import faker from 'faker' ;
function fakeOrg(){
const namePersonOrOrg = (Math.random() < 0.5)
? +' '+
return {
name: namePersonOrOrg,
// card: faker.helpers.userCard(),
// 'first name':,
// 'last name':,
// 'title':,
'homepage': faker.internet.url(),
// 'avatar': faker.internet.avatar(),
'address': faker.address.streetAddress(),
'address 2 (optional)': faker.address.secondaryAddress(),
'state': faker.address.state(),
'zip code': faker.address.zipCode(),
function repeatFunctionIntoArr(func, count){
let outputObj = []
for (let i=0; i< count; i++) {
return outputObj
console.log(repeatFunctionIntoArr(fakeOrg, 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment