Skip to content

West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 3 | Sprint 3 TDD Coursework - #1604

Open
maryam-devio wants to merge 5 commits into
CodeYourFuture:mainfrom
maryam-devio:coursework/sprint-3-practice-tdd
Open

West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 3 | Sprint 3 TDD Coursework#1604
maryam-devio wants to merge 5 commits into
CodeYourFuture:mainfrom
maryam-devio:coursework/sprint-3-practice-tdd

Conversation

@maryam-devio

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 have attempt all the TDD coursework according to the requirments and test all the changes.

@maryam-devio maryam-devio added 🐂 Size Medium 1-4 hours 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Aug 5, 2026
@hackertainment hackertainment added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The given example of aaaaa is a special case. There should be more general cases for multiple occurences.

Also, there is one more boundary case for no occurrences. Can you think of it?

@hackertainment hackertainment 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.

You generally got the right direction and just need to clear the logic a bit. Good work and keep it up :-)

function getOrdinalNumber(num) {
return "1st";
let getStr = num.toString();
let lastTwoDigit = getStr.slice(-2);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

while this line works even when the string only contains a single digit, it would be hard to maintain in a more complex project.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is no test case for the lastTwoDigit part of your function. Please add them back. Thanks.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please tidy-up the indentation so that it would be easier to read. It is also a good and important practice as well.

Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated
}
return result;
}
else if (count == 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.

why this else if is needed?

Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated
// The goal is to re-implement that function, not to use it.
return "hellohellohello";
let result="";
if (count >=1){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why this if is needed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about empty string (with the same set of counts 3, 1, 0, -1)?

@hackertainment hackertainment added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 7, 2026
@maryam-devio

Copy link
Copy Markdown
Author

Hello, thank you for your valuable feedback. I learned from all the comments you made. I've updated my code and pushed the changes. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 🐂 Size Medium 1-4 hours 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants