mafintosh / mafintosh/sorted-array-functions
gte gives wrong index
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 56
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
sorted.gte([1,1,1,1,1], 1)
Expected result:
0
Actual result:
2
One could also say the documentation is a bit ambiguous:
Get the index of the first value that is >=. If the value could not be found -1 is returned.
What is "first value" ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the sorted.gte entry point and reproduce the reported call with the repeated array values. Update the behavior so the first qualifying index is returned, and clarify the meaning of “first value” in the documentation; verify that the example returns 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100