🔥 [LeetCode The Hard Way] 🔥 n++
Javascript\n\njs\nvar createCounter = function(n) {\n    return function() {\n        return n++;\n    };\n};\n\n\nTypescript\n\nts\nfunction createCounter(n: n
Javascript\n\n```js\nvar createCounter = function(n) {\n    return function() {\n        return n++;\n    };\n};\n```\n\nTypescript\n\n```ts\nfunction createCounter(n: number): () => number {\n    return function() {\n        return n++;\n    }\n}\n```
['TypeScript', 'JavaScript']