Easy code beats 90%
Code\n\n// Define a function that takes an initial value `n` and returns another function\nfunction createCounter(n) {\n  // Return the counter function that us
# Code\n```\n// Define a function that takes an initial value `n` and returns another function\nfunction createCounter(n) {\n  // Return the counter function that uses the initial value `n` and increments it every time it is called\n  return function counter() {\n    let result = n; // Store the current value of `n` in a variable `result`\n    n++; // Increment the value of `n` for the next call to the function\n    return result; // Return the stored value of `n` from the current call\n  }\n}\n\n// Define a function that takes an initial value `n` and the number of times to call the counter function\nfunction getCounterSequence(n, numCalls) {\n  const counter = createCounter(n); // Create a counter function using the initial value `n`\n  const result = []; // Create an empty array to store the counter sequence\n  for (let i = 0; i < numCalls; i++) { // Loop `numCalls` times\n    result.push(counter()); // Call the counter function and push the result to the `result` array\n  }\n  return result; // Return the complete counter sequence\n}\n\n```
['JavaScript']