Skip to content

London | JAN-2026 ITP | Asha Ahmed | Sprint 3 | practice TDD coursework #1039

Open
ashaahmed7 wants to merge 6 commits intoCodeYourFuture:mainfrom
ashaahmed7:coursework/sprint-3-practice-tdd
Open

London | JAN-2026 ITP | Asha Ahmed | Sprint 3 | practice TDD coursework #1039
ashaahmed7 wants to merge 6 commits intoCodeYourFuture:mainfrom
ashaahmed7:coursework/sprint-3-practice-tdd

Conversation

@ashaahmed7
Copy link

@ashaahmed7 ashaahmed7 commented Feb 23, 2026

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

Implemented countChar using TDD approach.
Implemented getOrdinalNumber with correct handling of 11, 12, 13 special cases.
Implemented repeatStr including edge cases (0 count and negative count error).
Added Jest tests to cover normal cases, edge cases, and error scenarios.

Questions

n/a

@ashaahmed7 ashaahmed7 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 2026
@ashaahmed7 ashaahmed7 changed the title London | JAN-2026 ITP | Asha Ahmed | Sprint 3 | practice TDD coursework London | JAN-2026 ITP | Asha Ahmed | Sprint 3 | practice TDD coursework Feb 24, 2026
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.

Both implementation and tests look good.

Comment on lines +6 to +19
let ordinalResult = "";
switch (lastDigit) {
case "1":
ordinalResult = `${num}st`;
break;
case "2":
ordinalResult = `${num}nd`;
break;
case "3":
ordinalResult = `${num}rd`;
break;
default:
ordinalResult = `${num}th`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not return the value directly, like what you did on line 3?

@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 Mar 6, 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