I have been reading this code if I will replace scan with map I get can not get property "getTime" of undefined, why is it happening I assume that both operator takes an item emits from observable and apply some function on it
this.clock = Observable.merge(
this.click$,
Observable.interval(5000)
)
.startWith(new Date())
.map((acc : Date)=> {
const date = new Date(acc.getTime());
date.setSeconds(date.getSeconds() + 1);
return date;
});