Skip to content

Instantly share code, notes, and snippets.

@stoneboyindc
Created January 27, 2021 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stoneboyindc/8e77693fa45074eb9742e55d261f529b to your computer and use it in GitHub Desktop.
Save stoneboyindc/8e77693fa45074eb9742e55d261f529b to your computer and use it in GitHub Desktop.
const faker = require('faker');
function plantGenerator() {
let randomName = faker.name.findName();
let randomColor = faker.color();
return {
name: randomName,
color: randomColor
};
}
module.export = plantGenerator;
@Aaron-Clegg
Copy link

should be module.exports = plantGenerator; in order to get the function to be exported properly. Also 'let randomColor = faker.color()' comes back as not a function when run through IDE ive been trying to figure out why for a couple hours but am struggling to find the answer to fix that.

@Aaron-Clegg
Copy link

I have found the solution for why faker.color() is not coming back as a function you neet to have it as let randomColor = faker.commerce.color(); and it should run correctly

@Andre88-ar
Copy link

It even mentioned that in the instructions of the assignment, good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment