Pass the args without arrow function
Intuition\n\nThe setInterval function can accept the arguments without creating a closure using arrow functions. Simply pass them using the spread operator: set
# Intuition\n\nThe setInterval function can accept the arguments without creating a closure using arrow functions. Simply pass them using the spread operator: `setInterval(fn, t, ...args)`.\n\n# Code\n```\nfunction cancellable(fn: Function, args: any[], t: number): Function {\n    fn(...args);\n    const handle = setInterval(fn, t, ...args);\n    return () => clearInterval(handle);\n};\n```
['TypeScript']