Skip to content

Commit cad8a27

Browse files
authored
Update unique.md
`faker.animal.type` now has **44** possible animals ```ts import { faker } from "@faker-js/faker"; const animals = faker.helpers.uniqueArray(faker.animal.type, 1e3); const animalSet = new Set(animals); console.log(animals.length); // 44 console.log(animalSet.size); // 44 ```
1 parent 1633c8d commit cad8a27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guide/unique.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ faker.animal.type(); //'horse'
1010
faker.animal.type(); //'horse'
1111
```
1212

13-
Some methods and locales use much smaller data sets than others. For example, `faker.animal.type` has only 13 possible animals to choose from. In contrast, `faker.person.fullName()` pulls from a list of hundreds of first names, surnames, and prefixes/suffixes, so it can generate hundreds of thousands of unique names. Even then, the [birthday paradox](https://en.wikipedia.org/wiki/Birthday_Paradox) means that duplicate values will quickly be generated.
13+
Some methods and locales use much smaller data sets than others. For example, `faker.animal.type` has only 44 possible animals to choose from. In contrast, `faker.person.fullName()` pulls from a list of hundreds of first names, surnames, and prefixes/suffixes, so it can generate hundreds of thousands of unique names. Even then, the [birthday paradox](https://en.wikipedia.org/wiki/Birthday_Paradox) means that duplicate values will quickly be generated.
1414

1515
Sometimes, you want to generate unique values. For example, you may wish to have unique values in a database email column.
1616
There are a few possible strategies for this:

0 commit comments

Comments
 (0)