JavaScript Why setInterval() inside Observable.create() keeps on running?

I'm studying rxjs Observables and I couldn't understand why the setInterval inside Observable.create is still running even I have unsubscribe to that observable object. Observable is async right? When it supposed to stop?

I have this code for reference:

var cancellableObserver = Observable.create((observer:any)=>{
try {
    observer.next("anyeong")
    observer.next("ande")
    console.log("logged once")
    setInterval(()=>{
        //this code block will keep running for every 2secs
        observer.next("eotteokke") //but this line will stop after unsubscribe
        console.log("will log every 2secs")
    },2000)
} catch (err) {
    observer.error(err);

}});

var cancellableSubscription = cancellableObserver.subscribe(
(x:any) =>addItem(x),
(err:any) =>addItem(err),
() => addItem("cancellable completed"));

setTimeout(() => {cancellableSubscription.unsubscribe();console.log("mary");}, 6001);
Answer:1

I have a simple set up to find top scores. The goal is to order who received the highest scores and then give the top 3 bonus points. Question: In part two below I am looping through the people and ...

I have a simple set up to find top scores. The goal is to order who received the highest scores and then give the top 3 bonus points. Question: In part two below I am looping through the people and ...

I have basically this structure for my data (this.terms): { name: 'First Category', posts: [ { name: 'Jim James', tags: [ 'nice', 'friendly' ...

I have basically this structure for my data (this.terms): { name: 'First Category', posts: [ { name: 'Jim James', tags: [ 'nice', 'friendly' ...

During development of a vue project, and got some doubt regarding template / render / VNode. After reading the document https://vuejs.org/v2/guide/syntax.html, and google search, still didn't ...

During development of a vue project, and got some doubt regarding template / render / VNode. After reading the document https://vuejs.org/v2/guide/syntax.html, and google search, still didn't ...

  1. what is a relationship template

I have the following object: productDetails: { cislife: [], prime: [] } I want to return null instead of empty array if there aren't any values available. e.g: I want to check if any of ...

I have the following object: productDetails: { cislife: [], prime: [] } I want to return null instead of empty array if there aren't any values available. e.g: I want to check if any of ...

  1. loop through object javascript
  2. loop through object keys javascript
  3. loop through object properties
  4. loop through object typescript
  5. loop through object keys
  6. loop through object properties c#
  7. loop through object c#
  8. loop through object array javascript
  9. loop through object react
  10. loop through object es6
  11. loop through object php
  12. loop through object java
  13. loop through object lodash
  14. loop through object angular
  15. loop through object jquery
  16. loop through object python
  17. loop through object javascript es5
  18. loop through object javascript key value
  19. loop through object values
  20. loop through object jsx