[ JavaScript ] ✅✅ Simple JavaScript Solution | Typescript 🥳✌👍
If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 69 ms, faster than 6.77% of JavaScript online submissi
# If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 69 ms, faster than 6.77% of JavaScript online submissions for Counter.\n# Memory Usage: 41.9 MB, less than 56.40% of JavaScript online submissions for Counter.\n\n\tvar createCounter = function(n) {\n\t\treturn function() {\n\t\t\tlet result = n;\n\t\t\tn = n + 1;\n\t\t\treturn result;\n\t\t};\n\t};\n\n# Runtime: 62 ms, faster than 53.54% of TypeScript online submissions for Counter.\n# Memory Usage: 43.4 MB, less than 27.19% of TypeScript online submissions for Counter.\n\n\tfunction createCounter(n: number): () => number {\n\t\treturn function() {\n\t\t\tvar result = n++ ;\n\t\t\treturn result;\n\t\t}\n\t}\n# Thank You \uD83E\uDD73\u270C\uD83D\uDC4D
['TypeScript', 'JavaScript']