Exercise: Playing with Errors

Practice how to emit a specific error event based on a few checks.

Problem statement

Modify the function created in the “Exercise: A Simple Modification” lesson so that it produces an error if the timestamp at the moment of a tick (including the initial one) is divisible by 5. Propagate the error using both the callback and the event emitter.

If you’re unsure about how to do this, click the “Show Hint” button.

Get hands-on with 1200+ tech skills courses.