Created
January 27, 2021 17:01
-
-
Save stoneboyindc/8e77693fa45074eb9742e55d261f529b 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
const faker = require('faker'); | |
function plantGenerator() { | |
let randomName = faker.name.findName(); | |
let randomColor = faker.color(); | |
return { | |
name: randomName, | |
color: randomColor | |
}; | |
} | |
module.export = plantGenerator; |
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
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
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.