Skip to content

04_removeFromArrray: missing test case - #432

Merged
CouchofTomato merged 1 commit into
TheOdinProject:mainfrom
damon314159:patch-1
Feb 5, 2024
Merged

04_removeFromArrray: missing test case#432
CouchofTomato merged 1 commit into
TheOdinProject:mainfrom
damon314159:patch-1

Conversation

@damon314159

Copy link
Copy Markdown
Member

Because

A learner popped into discord to show off their code that passed all the tests. It used the splice technique many learners go for. This creates a problem for most learners for the test that removes all elements, since splicing changes the indexing and they will skip over some elements. However this particular learner had nested loops for the rest parameter and the source array, so this problem would only show itself if there were two adjacent entries of the same value to be removed.

This PR

Adds a test case to catch that scenario

Additional Information

https://discord.com/channels/505093832157691914/1179952911548174346/1203859773611843625

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

@CouchofTomato
CouchofTomato merged commit d740f2d into TheOdinProject:main Feb 5, 2024
@damon314159
damon314159 deleted the patch-1 branch February 5, 2024 15:27
Oussama5379 added a commit to Oussama5379/javascript-exercises that referenced this pull request Feb 1, 2025
04_removeFromArrray: missing test case
painooo pushed a commit to painooo/javascript-exercises that referenced this pull request Dec 29, 2025
04_removeFromArrray: missing test case
Paodpdro pushed a commit to Paodpdro/javascript-exercises that referenced this pull request May 19, 2026
04_removeFromArrray: missing test case
FredTheJanitor pushed a commit to FredTheJanitor/javascript-exercises that referenced this pull request May 29, 2026
04_removeFromArrray: missing test case
FredTheJanitor pushed a commit to FredTheJanitor/javascript-exercises that referenced this pull request May 29, 2026
04_removeFromArrray: missing test case
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