JS - setTimeout / clearTimeout  - 2 lines
Intuition\nsetTimeout for fn execution for given time t, return function that executes clearTimeout when called\n\n# Code\n\nconst cancellable = function(fn, ar
# Intuition\nsetTimeout for fn execution for given time t, return function that executes clearTimeout when called\n\n# Code\n```\nconst cancellable = function(fn, args, t) {\n    const timeoutHandle = setTimeout(() => fn(...args), t)    \n    return () => clearTimeout(timeoutHandle)\n};\n```
['JavaScript']