Skip to content

Conversation

karimdevelops
Copy link
Contributor

@karimdevelops karimdevelops commented Sep 28, 2025

Because

I have added three more test examples including an empty Array, single element and already sorted one. Also, the following text kinda works but I think it will be more readable and easier to copy if we write it in bullet points.

An input of [3, 2, 1, 13, 8, 5, 0, 1] should return [0, 1, 1, 2, 3, 5, 8, 13], and an input of [105, 79, 100, 110] should return [79, 100, 105, 110].

To
Test Examples:

  • mergeSort([])[]
  • mergeSort([73])[73]
  • mergeSort([1, 2, 3, 4, 5])[1, 2, 3, 4, 5]
  • mergeSort([3, 2, 1, 13, 8, 5, 0, 1])[0, 1, 1, 2, 3, 5, 8, 13]
  • mergeSort([105, 79, 100, 110][79, 100, 105, 110]

These tests are good, and I failed the first two myself.

This PR

  • Add new test examples
  • Reformat test examples

Issue

Closes #XXXXX

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • 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 any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Sep 28, 2025
@karimdevelops karimdevelops changed the title JavaScript Course Project Recursion: Revise and add Test examples JavaScript Course Project Recursion: Add and Reformat Test Examples Sep 28, 2025
Copy link
Contributor

@JoshDevHub JoshDevHub left a comment

Choose a reason for hiding this comment

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

This is a great change I think!

Once again, this update will also need to occur in the Ruby course's version of the project

Note that Ruby has a slightly different naming convention for function/method signatures than JavaScript does. So this type of change needs to happen:

# instead of:
`mergeSort([])``[]`

# do this in the Ruby course:
`merge_sort([])``[]`

@karimdevelops
Copy link
Contributor Author

I am glad to contribute to TOP, all changes are done now. This time especially this merge sort one was completely my own and a bigger contribution compared to my very first one which was about Lorem Ipsum shortcut in vs code haha.

Copy link
Contributor

@JoshDevHub JoshDevHub left a comment

Choose a reason for hiding this comment

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

Just one small fix that I forgot to mention related to Ruby method references, but after that this will be good to approve and merge. Thank you for the work you've done on these computer science lessons 🙌

Co-authored-by: Josh Smith <jmsmith1018@gmail.com>
@JoshDevHub JoshDevHub merged commit 9b87ab9 into TheOdinProject:main Oct 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content: JavaScript Involves the JavaScript course

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants