Solutions in two different approaches....
Day 2 of JavaScript\n\n## Code 1\njavascript []\n/**\n * @param {number} n\n * @return {Function} counter\n */\nvar createCounter = function(n) {\n    let count
# Day 2 of JavaScript\n\n## Code 1\n```javascript []\n/**\n * @param {number} n\n * @return {Function} counter\n */\nvar createCounter = function(n) {\n    let count = n;\n    return function() {\n        return count++;\n    };\n};\n```\n## Code 2\n```javascript []\nvar createCounter = function(n) {\n    let count = n;\n    return function counter() {\n        if (count <= n + 2) {\n            return count++;\n        } else {\n            return "Counter limit reached";\n        }\n    };\n};\n```
['Recursion', 'JavaScript']