72. implement Observable interval()

JavaScript
Is this helpful ?

easy  - accepted / - tried

This is a follow-up on 57. create an Observable.

Suppose you have solved 57. create an Observable, here you are asked to implement a creation operator interval().

From the document, interval()

Creates an Observable that emits sequential numbers every specified interval of time

interval(1000).subscribe(console.log);

Above code prints 0, 1, 2 .... with an interval of 1 seconds.

Note Observable is already given for you, no need to create it.

Let's try to solve this problem within 10 mintues.

Discuss(11)