function
stable
Creates an Observable that emits a sequence of numbers within a specified range.
range(start: number = 0, count?: number, scheduler?: SchedulerLike): Observable<number>
start | Optional. Default is The value of the first integer in the sequence. |
count | Optional. Default is The number of sequential integers to generate. |
scheduler | Optional. Default is A |
Observable<number>
: An Observable of numbers that emits a finite range of sequential integers.
Emits a sequence of numbers in a range.
range
operator emits a range of sequential integers, in order, where you select the start
of the range and its length
. By default, uses no SchedulerLike
and just delivers the notifications synchronously, but may use an optional SchedulerLike
to regulate those deliveries.
Emits the numbers 1 to 10
import { range } from 'rxjs'; const numbers = range(1, 10); numbers.subscribe(x => console.log(x));
© 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/index/function/range