Without the ready flag, every call runs immediately.
Acceptance criteria
- 1.#out should show 1 ran.
Without the ready flag, every call runs immediately.
function throttle(fn, interval) { return function (...args) { fn(...args); }; } let calls = 0; const throttled = throttle(function () { calls++; }, 10); throttled(); throttled(); throttled(); document.querySelector('#out').textContent = calls + " ran";
Output ready when you are
Press Run to render your code, or Submit to validate your solution.