Skip to content

Conversation

@AhmadHmedann
Copy link

@AhmadHmedann AhmadHmedann commented Nov 30, 2025

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Complete all Sprint 2 tasks

Questions

I accidentally committed the median exercise to the Sprint 2 branch. What’s the best way to fix it?

@AhmadHmedann AhmadHmedann added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 30, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Groups/blob/general-review-feedback/Sprint-2/feedback.md

Doing so can help reviewers speed up the review process. Thanks.


This PR branch is being compared to CYF's main. So the files in CYF's main are considered the original version.

One way to undo (revert changes) is to replace the changed files you want to "undo" by their "original version".

You can download CYF's main as a ZIP file, unzip them to a temp folder, and then manually copy the files from this temp folder to your branch (to replace the files you want to undo).

After you have replaced all the files, make a commit and push your changes to GitHub.

Double check to ensure all unrelated files are replaced.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 30, 2025
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 30, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Code looks good. Just have some suggestions.

Comment on lines 16 to 18
for (const ingredient of recipe.ingredients) {
console.log(ingredient);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can also consider using Array.prototype.join().

Comment on lines 4 to 6
for (let i = 0; i < myArray.length; i++) {
myObject[myArray[i][0]] = myArray[i][1];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could consider exploring

  • for-of loop
  • Array destructuring

They can help simplify the code and improve readability (if used correctly).

Copy link
Author

Choose a reason for hiding this comment

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

Thanks a lot for the feedback, it’s really helped me improve my skills

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 3, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Dec 3, 2025

The branch is not clean. Can you revert all unrelated changes in the Sprint-1 folder?

@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Dec 5, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Dec 5, 2025

Changed files in a PR == difference between the PR branch and the target branch. (In this PR, the target branch is CYF's main)

Removed files are still considered changed files because they exist in the target branch but not in the PR branch.

If we want to make a file, X, to not appear as a changed file in the PR, we will need to make sure the file, X, in the PR branch, is identical to the same file in the target branch. And one way to do that is to replace the file in the PR branch by the same file in the target branch.

Can you update this branch so that no files in the "Sprint-1" folder is identified as a changed file in the "Changed files" tab?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 5, 2025
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Dec 5, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Dec 5, 2025

When replacing a file, copy/pasting the content may not always work as expected. Even a single extra space or newline between the source and target files can cause the file to be flagged as “changed.” To avoid this, always replace the file directly instead of copy/pasting its contents.

image

You did a good job in the exercise. Just be extra careful when creating branch in the future.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants