JS ["Solution"]
Code\njavascript []\n/**\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n */\nvar cancellable = function (fn, arg
# Code\n```javascript []\n/**\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n */\nvar cancellable = function (fn, args, t) {\n    fn(...args)\n\n    const id = setInterval(() => fn(...args), t)\n\n    function cancelFn() {\n        clearInterval(id)\n    }\n\n    return cancelFn\n};\n```
['JavaScript']