Skip to content

London | May-2026-itp | Vitalii Kmit | Sprint 3 | practice TDD coursework#1527

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

London | May-2026-itp | Vitalii Kmit | Sprint 3 | practice TDD coursework#1527
Vitalii-code wants to merge 9 commits into
CodeYourFuture:mainfrom
Vitalii-code:coursework/sprint-3-practice-tdd

Conversation

@Vitalii-code

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

Worked on the coursework by writing tests first and then code for them

@Vitalii-code Vitalii-code added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 18, 2026
@hey-hammad hey-hammad 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 Jul 25, 2026

@hey-hammad hey-hammad 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 Implementation overall, couple of minor fixes required.

return "1st";
// handle special cases

if (typeof num !== "number" || Number.isNaN(num)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

a decimal number will still pass through this guard block, can you think of a better way to make this more robust?

}

const snum = String(num); // num as a string
const thList = ["0", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]; // list of numbers that should end up with th as a suffix

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 can drop the 0,4,5... from the list here and handle them in switch for the "th" scenario.

@hey-hammad hey-hammad 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 Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants