what is difference between 'of' and 'from' in Rxjs

questionsCategory: Questionswhat is difference between 'of' and 'from' in Rxjs
Sandhya asked 3 years ago

hi i want to lean Rxjs. i have a doubt when to use ‘of’ and when to use ‘from’. please give a sample example

Share this:

Copy and paste this code into your website.

1 Answers
Satya answered 3 years ago

Hi sandhya, see below example to find difference between ‘of’ and from in Rxjs
Use of ‘of’ in Rxjs
const cities = [“delhi”,”mumbai”, “pune”];
[“delhi”, “mumbai”, “pune”]
Use of ‘from’ in Rxjs
const cities = [“delhi”,”mumbai”, “pune”];

  • “delhi”
  • “mumbai”
  • “pune”

I hope your doubt would be clear.

Your Answer

13 + 16 =