Skip to content

London | ITP-Jan-26 | Abdul Moiz | Sprint 3 | Practice TDD#917

Closed
A-Moiz wants to merge 2 commits into
CodeYourFuture:mainfrom
A-Moiz:coursework/sprint-3-practice-tdd
Closed

London | ITP-Jan-26 | Abdul Moiz | Sprint 3 | Practice TDD#917
A-Moiz wants to merge 2 commits into
CodeYourFuture:mainfrom
A-Moiz:coursework/sprint-3-practice-tdd

Conversation

@A-Moiz

@A-Moiz A-Moiz commented Jan 28, 2026

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

Completed all exercises in Practice TDD directory

Questions

N/A

@A-Moiz A-Moiz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 28, 2026
Comment on lines +3 to +4
let lastDigit = stringNum[stringNum.length - 1];
if (lastDigit === "1" && num % 100 !== 11) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Why not also store the last two digits in a variable first?
  • Why use different data type to represent the last digit and the last two digits?
  • For variables not need to be reassigned a value, it is a better practice to declare them using const.

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.

Resolved function by storing last 2 digit.

Comment on lines +41 to +43
test("should append 'th' for all other numbers", () => {
expect(getOrdinalNumber(4)).toEqual("4th");
expect(getOrdinalNumber(11)).toEqual("11th");

@cjyuan cjyuan Feb 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could consider testing more samples in this category to make the test more comprehensive.

Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated
} else {
throw new Error("Count must be a non-negative integer");
}
return "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code on line 9 is unreachable (we call them "dead code").

Could consider not using else because of the return statements inside the if-blocks.

@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 Feb 12, 2026
@A-Moiz A-Moiz 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 Feb 14, 2026
@cjyuan

cjyuan commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

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 Feb 14, 2026
@illicitonion

Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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.

3 participants