Skip to content

London | 26-ITP-May | Vito Moratti | Sprint 3 | practice tdd#1526

Open
vmoratti wants to merge 9 commits into
CodeYourFuture:mainfrom
vmoratti:coursework/sprint-3-practice-tdd
Open

London | 26-ITP-May | Vito Moratti | Sprint 3 | practice tdd#1526
vmoratti wants to merge 9 commits into
CodeYourFuture:mainfrom
vmoratti:coursework/sprint-3-practice-tdd

Conversation

@vmoratti

Copy link
Copy Markdown

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

I had to rewrite all the code and tests.

@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 17, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 22, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good start, I have a few follow up comments

Comment thread Sprint-3/2-practice-tdd/count.js Outdated
let count = 0;
for (let char of stringOfCharacters) {
if (char === findCharacter) {
count ++;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Purely a matter a style, I recommend putting the increment operator immediately after the variable, without a space.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks. Done

@@ -1,5 +1,32 @@
function getOrdinalNumber(num) {
return "1st";
if (num % 100 === 11) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As these first 3 branches are all returning the same thing, is there a way they could be simplified?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have now changed it and combined those branches in one.

Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated

module.exports = repeatStr;
//console.log(repeatStr("hello", -1));
//console.log(repeatStr("hello", 0));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remember to remove commented out code if it is not needed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated
var i;
if (num < 0) {
throw new Error("negative numbers are not valid");
} else if (num === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does this special num===0 case do?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks. I have now removed it and code is works still.

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 22, 2026
vmoratti added 3 commits July 22, 2026 12:44
Updated the getOrdinalNumber function to correctly handle numbers ending in 11, 12, and 13 as 'th'. Added additional test cases for validation.
Removed unnecessary checks for zero and commented-out test cases.

@vmoratti vmoratti left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

acted upon comments

@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 22, 2026
@LonMcGregor

Copy link
Copy Markdown

Great! This task is complete now

@LonMcGregor LonMcGregor 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 22, 2026
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