Easy solution ✅
\nTime Complexity:O(1)\nSpace Complexity:O(1)\n\n\n```\n/*\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n /\nva
\nTime Complexity:O(1)\nSpace Complexity:O(1)\n\n\n```\n/**\n * @param {Function} fn\n * @param {Array} args\n * @param {number} t\n * @return {Function}\n */\nvar cancellable = function(fn, args, t) {\n  const timeoutId = setTimeout(function() {\n    fn.apply(null, args);\n  }, t);\n\n  const cancelFn = function() {\n    clearTimeout(timeoutId);\n  };\n\n  return cancelFn;\n};\n\n````\nThankyou:).
[]