Skip to content

Conversation

@M-Abdoon
Copy link

Learners, PR Template

Self checklist

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

Changelist

I've implemented the required functions, fixed and made implementation tests.

Questions

No questions so far, thank you

@M-Abdoon M-Abdoon added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 14, 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.

@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 21, 2025
@M-Abdoon
Copy link
Author

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.

I improved the code according the general feedback. thank you.

@M-Abdoon M-Abdoon 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 22, 2025
Comment on lines +31 to +44
let outputObject = Object.create(null);
let splitString = string.split(" ");

for ( let i = 0; i < splitString.length; i++) {
let word = splitString[i].toLowerCase();
word = word.replace(/[.,!?]/g, '');

if (word.length != 0) {
if (!outputObject[word])
outputObject[word] = 1;
else
outputObject[word]++;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Your code work. The followings are some improvements you can consider:

If we specified the word separator as "one or more space characters" instead of a single space character, the code in the loop could have less empty strings to deal with.

We could also normalize string (the parameter) by applying the "conversion operations" on lines 35-36 to string before line 32 once. Doing so could simplify the code within the loop (and slightly improve the performance).

Copy link
Author

Choose a reason for hiding this comment

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

Yes, the function could be much better than it is right now, but unfortunately, due to lack of time, I didn’t work on improving it (and also couldn’t do the other stretch exercises for the same reason). I’m already running late.
But will try to make the improvements when I am able to.
Thank you so mcuh.

@M-Abdoon
Copy link
Author

Changeds have been made to the code. Thank you.

@cjyuan
Copy link
Contributor

cjyuan commented Nov 22, 2025

This branch now contains only 2 files related to "Alarm Clock" exercise. The Sprint-2 script I reviewed are "gone".

You can use "git revert" to undo some the most recent commits to restore your Sprint-2 files.

@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 22, 2025
@M-Abdoon M-Abdoon 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 23, 2025
@M-Abdoon
Copy link
Author

This branch now contains only 2 files related to "Alarm Clock" exercise. The Sprint-2 script I reviewed are "gone".

You can use "git revert" to undo some the most recent commits to restore your Sprint-2 files.

Ah sorry my fault. I reverted the last commits. Now the files should exist.

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.

Changes look good! Well done!

@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 Nov 23, 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.

2 participants