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

Fix: 04-02 test case causes max call stack exceeded #13

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ADSmith-0
Copy link

  • Added sumUpTo import to 04-recursion/02-unwinding/sum-up-to-test.js as I was getting an undefined function error otherwise
  • Modified recursive function so that it can handle cases where n <= 0. This is because one of the test cases is expect(sumUpTo(0)).toBe(0);, so if it's run as is then the case where n === 0 is never handled in the function which causes infinite recursion

@ADSmith-0 ADSmith-0 changed the title Fix: 04-02 Fix: 04-02 test case causes infinite recursion Oct 12, 2023
@ADSmith-0 ADSmith-0 changed the title Fix: 04-02 test case causes infinite recursion Fix: 04-02 test case causes max call stack exceeded Oct 12, 2023
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

Successfully merging this pull request may close these issues.

1 participant