> For the complete documentation index, see [llms.txt](https://soufatn.gitbook.io/rxjs-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soufatn.gitbook.io/rxjs-book/summary/observable/observable_instance_methods/maxby.md).

# maxBy

Returns the maximum value in an observable sequence according to the specified comparer.

## Arguments

1. `keySelector` *(`Function`)*: Key selector function.
2. `[comparer]` *(`Function`)*:  Comparer used to compare elements.

## Returns

*(`Observable`)*: An observable sequence containing a list of zero or more elements that have a maximum key value.

## Example
