Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Make Counter #117

Open
2 of 8 tasks
MonsterPi13 opened this issue Feb 18, 2024 · 0 comments
Open
2 of 8 tasks

Issue with Make Counter #117

MonsterPi13 opened this issue Feb 18, 2024 · 0 comments

Comments

@MonsterPi13
Copy link

Your GreatFrontEnd account email (optional)

rpishappynow@gmail.com

Problematic section

  • Question Description
  • Question Skeleton
  • Question Solution
  • Test Cases (Missing/Incorrect/Unclear)

Type of question

  • JavaScript
  • User Interface
  • System Design
  • Quiz

Describe the issue

The test cases are incomplete. They do not cover scenarios involving the initialValue parameter.

Code you used to submit (where relevant)

export default function makeCounter(initialValue: number = 0): () => number {
  let count = -1;
  
  return () => {
    count += 1;
    return count;
  };
}

Expected behavior vs Actual behavior (where relevant)

The code can pass the test cases successfully, but it should fail the test cases that lack initialValue scenarios when the function has an initialValue parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant