Skip to content

London | 26-ITP-May | Chun Yan Wong | Sprint 1 | CourseWork#1466

Open
cywong-dev wants to merge 14 commits into
CodeYourFuture:mainfrom
cywong-dev:coursework/sprint-1
Open

London | 26-ITP-May | Chun Yan Wong | Sprint 1 | CourseWork#1466
cywong-dev wants to merge 14 commits into
CodeYourFuture:mainfrom
cywong-dev:coursework/sprint-1

Conversation

@cywong-dev

Copy link
Copy Markdown

Learners, PR Template

Self checklist

[X] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
[X] My changes meet the requirements of the task
[X] I have tested my changes
[X] My changes follow the style guide

Changelist

Complete the coursework for sprint 1 in the module Structuring and testing data

cywong-dev added 14 commits July 5, 2026 14:46
Added comment explaining the increment operation on the count variable.
Initialize dir and ext variables to extract directory and file extension from filePath.
[ChunYanWong] Added comment explaining num as a random integer.
Updated last4Digits assignment to correctly extract the last 4 digits of cardNumber.
Added comments to clarify variable declarations, function calls, and expressions related to movie length.
Added comments to explain the purpose of each step in the code.
Clarify the effects and return values of alert and prompt functions.
Added syntax help for console.log and console.
@github-actions

This comment has been minimized.

@cywong-dev cywong-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 5, 2026
@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 5, 2026
@github-actions

This comment has been minimized.

@cywong-dev cywong-dev changed the title London | May-2026-ITP | Chun Yan Wong | Module-Structuring-and-Testing-Data/sprint 1/CourseWork London | May-2026-ITP | Chun Yan Wong | Module-Structuring-and-Testing-Data/sprint 1 | CourseWork Jul 5, 2026
@github-actions

This comment has been minimized.

@cywong-dev cywong-dev changed the title London | May-2026-ITP | Chun Yan Wong | Module-Structuring-and-Testing-Data/sprint 1 | CourseWork London | 26-ITP-May | Chun Yan Wong | Sprint 1 | CourseWork Jul 5, 2026
@cywong-dev cywong-dev 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 Jul 5, 2026
// https://www.google.com/search?q=get+first+character+of+string+mdn

// added by ChunYanWong for the solution
initials = firstName.substring(0,1) + middleName.substring(0,1) + lastName.substring(0,1);

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.

There is a much shorter syntax to get the first character (or any character by its index) of a string.


const dir = ;
const ext = ;
const dir = filePath.substring(0, url.lastIndexOf("/") + 1);;

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.

  • What is url?

  • Should "dir" contain a trailing /?

// [ChunYanWong] The slice method extract substring starting with the first parameter position
// There is no -4 starting position and hence it will not work

const last4Digits = cardNumber.slice(cardNumber.length - 4)

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.

Did you execute the code to ensure it works as expected?

Comment on lines +1 to +2
const twelveHourClockTime = "8:53pm";
const twentyhourClockTime = "20:53";

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.

It's a not a good idea to have two almost identical variable names. Besides, the second name is not quite in "lower camel case" format. Could you rename the variable(s)?

//[ChunYanWong] 3 . They are Number, replaceAll and console.log

// 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?
// [ChunYanWong] syntax error - add the comma to fix it.

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.

What is this programming term that refers to the values passed to a function? It begins with an 'a'.

Comment on lines 23 to +25
What is the return value of `prompt`?

[ChunYanWobg] Inputted name

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.

What if a user enters a name and clicks "Cancel" instead of "OK"?

Comment on lines 23 to +25
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?

[ChunYanWong] The method of the object console or the functions of the object console

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 last question had a second part. Could you also answer that?

@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 Jul 7, 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