Skip to content
Discussion options

You must be logged in to vote

Well, seeding a Faker instance with the same value equals in same return values from different instances (or even the same one).

Example:

const one = new Faker(); // for simplicity without actual parameters
const two = new Faker(); // for simplicity without actual parameters

const mySeed = 1337;
one.seed(mySeed);
one.name.firstName(); // Devyn
one.name.firstName(); // Craig

two.seed(mySeed);
two.name.firstName(); // Devyn
two.name.firstName(); // Craig

// reset to get same values "again"
one.seed(mySeed);
one.name.firstName(); // Devyn
one.name.firstName(); // Craig

Stackblitz example

If you need anything more specific, you might want to be more specific on your question.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@xDivisionByZerox
Comment options

@xDivisionByZerox
Comment options

@Minozzzi
Comment options

@xDivisionByZerox
Comment options

@Minozzzi
Comment options

Answer selected by ST-DDT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants