Skip to content

Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework#1369

Open
Tobias-Amaechina wants to merge 48 commits into
CodeYourFuture:mainfrom
Tobias-Amaechina:coursework
Open

Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework#1369
Tobias-Amaechina wants to merge 48 commits into
CodeYourFuture:mainfrom
Tobias-Amaechina:coursework

Conversation

@Tobias-Amaechina

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

This is PR for coursework Solutions for Sprin-1 of the "Module-Structuring- and Testing-Data Module, it covers key exercises on JavaScript fundamentals (variable assignments, string manipulations , String methods ,random numbers , and mandatory error fixing activities along with interpretation exercises that test understanding of code behaviour and syntax .
1-key-exercises/ — 4 files with solutions for count, initials, paths, and random number generation
2-mandatory-errors/ — 5 files fixing syntax/logic errors (comments, variable scope, type issues, naming)
3-mandatory-interpret/ — 3 files with detailed explanations of code behavior
4-stretch-explore/ — 2 files exploring browser APIs and object concepts

… and it reads number, I have to comment out slice method line of code
… original code to see that error message says TypeError: cardNumber.slice is not a function
…e quotes around the numbers and printing last4Digits
…$ so the the first varible was name was updated to start with doller sign
@github-actions

This comment has been minimized.

@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 21, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 21, 2026
@Tobias-Amaechina Tobias-Amaechina changed the title Birmingham | 26-ITP-May | Tobias Amaechina | Sprint-1 | coursework Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework Jun 21, 2026
@Tobias-Amaechina Tobias-Amaechina added 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 Jun 21, 2026
Comment on lines 6 to +8
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

let initials = ``;
let initials = `"${firstName[0]}${middleName[0]}${lastName[0]}"`;

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.

Note: Usually the double quotes surrounding a string are not part of the sting value; they are only used to indicate the boundary of the string.

No change needed.

@@ -1,9 +1,17 @@
const cardNumber = 4533787178994213;
const cardNumber = "4533787178994213";

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.

Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) to still being able to use .slice(-4) to extract the last 4 digits from the given number.

Comment on lines +1 to +2
const $12HourClockTime = "8:53pm";
const _hourClockTime = "20:53"; No newline at end of file

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.

Identifiers that begin with _ or $ are valid variable names. However, they are usually used by convention to signal special meaning.

Could you explore names that start with alphabets instead? Feel free to ask AI for suggestion.

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
// The error is occurring on line 5., and it's a SyntaxError: missing , The error is due to a missing comma in the replaceAll() method. The correct syntax should be replaceAll(",", ""). To fix this problem, we need to add the missing comma in the replaceAll() method on line 5

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.

We could more precisely describe "A comma is missing between "," and "" in the function call" as:
A comma is missing between the ___________s.

Could you look up the programming term that belongs in the blank?

@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 Jun 23, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants