Throttle Event Handler

Write a throttle function for an event handler that limits API calls to once every 5 seconds, remembering and firing the latest event after the timeout.

Asked in frontend interviews at SironaMedical and LinkedIn