docs(minBy): Fix example in minBy (#141)

change the returns : { a : 3 } to { a : 1 }
This commit is contained in:
ethan 2024-07-09 19:37:00 +08:00 committed by GitHub
parent 2ce004c91b
commit 6f60b786d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,6 @@ The element with the minimum value as determined by the `getValue` function.
### Example ### Example
```typescript ```typescript
minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }
minBy([], x => x.a); // Returns: undefined minBy([], x => x.a); // Returns: undefined
``` ```