jashkenas / jashkenas/underscore

_.sortedLastIndex

Open
#1,882 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
27.3k
Forks
5.4k
Avg merge
2d 5h
Merged PRs (30d)
1

Description

Underscore has `_.sortedIndex` but this could be expanded to `_.sortedLastIndex` using a shared helper between them both (minimal code increase). This would allow `_.lastIndexOf` to support binary searches as well.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing implementations and tests for _.sortedIndex and _.lastIndexOf in the Underscore repository. Read how sorted searches currently work and determine where a shared helper would fit. Done means _.sortedLastIndex is available and _.lastIndexOf can use binary-search behavior without regressing existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.