[js] timers: test clearTimeout() and periodic function return