Redundant condition

Open
#378 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
data

Research direction

Open src/algorithms/math/fibonacci/fibonacci.js at the linked line and compare the condition with the surrounding while loop. Remove the redundant condition, then run the repository's Fibonacci-related tests to confirm existing behavior remains unchanged.

Written by the indexing model from the issue text.

Description

https://github.com/trekhleb/javascript-algorithms/blob/dc1047df725117c411959692a1ab538f65342b2e/src/algorithms/math/fibonacci/fibonacci.js#L13

This condition is redundant, the while condition covers the case where n equals 1.

p.s- I will exploit this opportunity to say thank you for this repository.

Dominant language
JavaScript
Stars
197k
Forks
31k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from trekhleb/javascript-algorithms

All issues in trekhleb/javascript-algorithms

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.