How do observables differ from promises?
|1.||Used from the library RxJS.
|2.||Can show multiple values using
||Can resolve only one async task and cannot be used again|
|3.||Can unsubscribe from the observables no longer needed.||A promise cannot be canceled.|
|4.||Lazy. Observable is called only when we subscribe.||Not lazy.|
|5.||Rich set of operators in the library like map, filter, pipe, retry, etc.||No such additional features available|
BY Best Interview Question ON 01 Mar 2020