Skip to content

14_fibonacci: add negative number example to readme - #660

Merged
mao-sz merged 4 commits into
TheOdinProject:mainfrom
GPerencine:fix-fibonacci-readme
Jul 28, 2026
Merged

14_fibonacci: add negative number example to readme#660
mao-sz merged 4 commits into
TheOdinProject:mainfrom
GPerencine:fix-fibonacci-readme

Conversation

@GPerencine

Copy link
Copy Markdown
Contributor

Because

The README for the Fibonacci exercise does not mention that passing a negative number should return "OOPS", even though this behavior is tested in fibonacci.spec.js. Adding this example clarifies the exercise requirements.

This PR

  • Adds fibonacci(-1); // returns "OOPS" example to the README code block.

Issue

N/A

Additional Information

N/A

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes any changes that affect the solution of an exercise, I've also updated the solution in the /solutions folder

@mao-sz mao-sz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, we should just add onto the end of the README that it should return "OOPS" if passed a negative number. The example code block is only for clarifying the previous instruction about the sequence starting at 1 instead of 0. Just having text instruction for negatives is sufficient.

@GPerencine

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I've updated the README to remove the code example and only added the text instruction at the end as requested.

@mao-sz mao-sz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the code block is specifically to give an example for the sentence about the Fibonacci sequence, the instruction about the negative arg should go after it at the end, not between it and its associated instruction.

@GPerencine

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback again! I've moved the note regarding negative numbers to the end of the README, right after the code example.

Comment thread foundations/14_fibonacci/README.md Outdated
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
@mao-sz
mao-sz merged commit d29992e into TheOdinProject:main Jul 28, 2026
@GPerencine
GPerencine deleted the fix-fibonacci-readme branch July 28, 2026 02:01
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.

2 participants