Skip to content

Commit

Permalink
Update cluster example (#361)
Browse files Browse the repository at this point in the history
Use bigger array to have cluster size (3) different from number of clusters (4)
  • Loading branch information
Minhir authored Feb 21, 2024
1 parent 94d43e7 commit 32a3de4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/array/cluster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ split as evenly as possible.
```ts
import { cluster } from 'radash'

const gods = ['Ra', 'Zeus', 'Loki', 'Vishnu', 'Icarus', 'Osiris', 'Thor']
const gods = ['Ra', 'Zeus', 'Loki', 'Vishnu', 'Icarus', 'Osiris', 'Thor', 'Apollo', 'Artemis', 'Athena']

cluster(gods, 3)
// => [
// [ 'Ra', 'Zeus', 'Loki' ],
// [ 'Vishnu', 'Icarus', 'Osiris' ],
// [ 'Thor' ]
// ['Thor', 'Apollo', 'Artemis'],
// ['Athena']
// ]
```

0 comments on commit 32a3de4

Please sign in to comment.