ServiceNow interview question

Write a throttled function in JavaScript. (LeetCode #2676)