Create count variable
Edit: Should use let instead of var\nlet: block scope\nvar: function scope\n\n/**\n * @param {number} n\n * @return {Function} counter\n */\nvar createCounter =
Edit: Should use ```let``` instead of ```var```\n```let```: block scope\n```var```: function scope\n```\n/**\n * @param {number} n\n * @return {Function} counter\n */\nvar createCounter = function(n) {\n    let count = n\n    return function() {\n        count++\n        return count - 1\n    };\n};\n\n/** \n * const counter = createCounter(10)\n * counter() // 10\n * counter() // 11\n * counter() // 12\n */\n```
['JavaScript']