Timer.func property

The func is the function called when the timer fires. It is usually set in the Timer() constructor; it can also be set via this property.

Example

> timer2 = new Timer(() => console.log("Repeat fire!"));
undefined
> timer2.scheduleRepeat(0.1);
undefined
Repeat fire!
Repeat fire!
> timer2.func = () => console.log("A different message");
undefined
A different message
> timer2.cancel()
undefined

References