> 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/subscribe.md).

# subscribe | forEach

`Rx.Observable.prototype.forEach([observer] | [onNext], [onError], [onCompleted])`]\(<https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/observable.js>)

Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.

## Arguments

1. `[observer]` *(Observer)*: The object that is to receive notifications.
2. `[onNext]` *(`Function`)*: Function to invoke for each element in the observable sequence.
3. `[onError]` *(`Function`)*: Function to invoke upon exceptional termination of the observable sequence.
4. `[onCompleted]` *(`Function`)*: Function to invoke upon graceful termination of the observable sequence.

## Returns

*(Disposable)*: The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.

## Example

### With no arguments

### With an observer

### Using functions
