- RxJS Tutorial
- RxJS - Home
- RxJS - Overview
- RxJS - Environment Setup
- RxJS - Latest Updates
- RxJS - Observables
- RxJS - Operators
- RxJS - Working with Subscription
- RxJS - Working with Subjects
- RxJS - Working with Scheduler
- RxJS - Working with RxJS & Angular
- RxJS - Working with RxJS & ReactJS
- RxJS Useful Resources
- RxJS - Quick Guide
- RxJS - Useful Resources
- RxJS - Discussion
RxJS - Creation Operator from
This operator will create an observable from an array, an array-like object, a promise, an iterable object, or an observable-like object.
Syntax
from(input: ObservableInput): Observable
Parameters
input − The input given to this operator is an Observable.
Return value − It returns an observable.
Example
import { from } from 'rxjs'; let arr = [2, 4, 6, 8 , 10]; let test = from(arr); test.subscribe(x => console.log(x));
Output
Advertisements
To Continue Learning Please Login
Login with Google