Clean code and explanation
Key Functionalities\n- Immediate Execution:\n\n    - fn(...args) is called right away, ensuring the first execution happens without any delay.\n- Repeated Execu
# Key Functionalities\n- Immediate Execution:\n\n    - fn(...args) is called right away, ensuring the first execution happens without any delay.\n- Repeated Execution:\n\n    - setInterval schedules the repeated execution of fn every t milliseconds.\n- Cancellation:\n\n    - The cancelFn stops the interval timer, halting further executions.\n\n# Code\n```typescript []\ntype JSONValue = null | boolean | number | string | JSONValue[] | { [key: string]: JSONValue };\ntype Fn = (...args: JSONValue[]) => void\n\nfunction cancellable(fn: Fn, args: JSONValue[], t: number): Function {\n    fn(...args);\n    let timer: NodeJS.Timeout;\n    const startTimer = () =>{\n        timer = setInterval(()=>{\n        fn(...args)\n    }, t);\n    }\n\n    const cancelFn = () =>{\n        clearInterval(timer);\n    };\n\n    startTimer();\n\n    return cancelFn;\n};\n\n```
['TypeScript']