Skip to content

Birmingham | 26-ITP-Jan | Arunkumar Akilan | Sprint 1 | Structuring-and-Testing-Data Coursework/Sprint1#1017

Open
arunkumarakilan wants to merge 23 commits intoCodeYourFuture:mainfrom
arunkumarakilan:coursework/sprint-1-
Open

Birmingham | 26-ITP-Jan | Arunkumar Akilan | Sprint 1 | Structuring-and-Testing-Data Coursework/Sprint1#1017
arunkumarakilan wants to merge 23 commits intoCodeYourFuture:mainfrom
arunkumarakilan:coursework/sprint-1-

Conversation

@arunkumarakilan
Copy link

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 PR includes all my work for Sprint 1.

Completed exercises and explanations for:

  • Key exercises (count, initials, paths, random)
  • Mandatory errors
  • Mandatory interpret (percentage change, time format, pounds)
  • Stretch explore (chrome, objects)
  • Added explanations and comments where required
  • Tested code using Node and Chrome console
  • Explained logic and evaluation order where requested

Questions

No questions at this time.

@github-actions

This comment has been minimized.

@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 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 Feb 22, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
Comment on lines +1 to +2
const cardNumber = "4533787178994213";
const last4Digits = cardNumber.slice(-4);
Copy link
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) so that you can still use .slice(-4) to extract the last 4 digits from the given number.

Copy link
Author

Choose a reason for hiding this comment

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

.slice() only works on strings. Initially I didn’t know about type conversion, so I changed the number into a string and then used .slice(-4) to extract the last four digits.
A correct way would be converting the number to a string and then slicing it, for example:
Number(String(cardNumber).slice(-4)) or Number(cardNumber.toString().slice(-4)).

Copy link
Author

Choose a reason for hiding this comment

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

.slice() only works on strings, so we first convert the number to a string.
Then we slice the last four digits and convert it back to a number.

Number(String(cardNumber).slice(-4))

@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 Mar 2, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 5, 2026

Please note that in CYF courses, the recommended way to inform the reviewer of your changes is to do both of the following:

  • Reply to their feedback. (Can you practice this in this PR?)
    • In the responses, clarify how each piece of feedback was addressed to demonstrate that you've carefully reviewed the suggestions.
      • You may find the suggestions in this PR Guide useful.
    • Your response may trigger a notification (depending on the reviewer's settings), helping ensure they’re aware of the updates you’ve made.
  • Replace the "Reviewed" label by a "Needs review" label (which you have done -- great!)
    • Without this label, the reviewer would not know if your changes is ready to be reviewed.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@arunkumarakilan
Copy link
Author

Sorry for not replying earlier to your two comments. I made the changes directly in VS Code and pushed them, but afterwards I couldn't find those two comments again to reply to them.

From my next PR onwards, I will make sure to reply to each piece of feedback and clearly explain the changes I made, as you suggested. Thank you for the guidance.

@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 5, 2026

Part of the PR process involves learning how to respond to reviewers' comments. So far, not every comment was addressed, either through explanations or through changes made to the files.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 6, 2026

I meant, reply directly in the comment box (the highlighted area in the pic) on GitHub (and on every comment).

image

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 7, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 7, 2026

@illicitonion Can you step in on this PR? I do not understand why @arunkumarakilan keep changing the labels without responding my inline comments.

Resolved. It was a misunderstanding. The trainee was unware the responses were in "Pending" state.

@arunkumarakilan
Copy link
Author

@illicitonion Can you step in on this PR? I do not understand why @arunkumarakilan keep changing the labels without responding my inline comments.

Hi, sorry for the confusion.

I have now replied to all the inline comments and updated the code where changes were suggested. I also resolved the conversations after addressing them.

If there is any comment I missed, please let me know and I will fix it. Thank you

@arunkumarakilan
Copy link
Author

arunkumarakilan commented Mar 7, 2026 via email

@cjyuan
Copy link
Contributor

cjyuan commented Mar 7, 2026

I can see that you have made changes in the files per my comment. What I was requesting is that you practice responding to inline comments. Even a short acknowledgement such as "Noted" or "Implemented" is enough (if the comment is not a question).

If you had left any response to my inline comments, can you check if they are marked "pending". Pending comments are comments that have not yet been submitted, and only you can see them.

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.

One more question.

Comment on lines +1 to +3
const cardNumber = 4533787178994213;
const last4Digits = cardNumber.slice(-4);
const last4Digits = Number(String(cardNumber).slice(-4));
console.log(last4Digits);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does your code output the value you expected ifcardNumber were 4533787178990001?

Copy link
Author

Choose a reason for hiding this comment

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

no so now i only convert to string and slice it thanks

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 7, 2026
@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 7, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 7, 2026

Changes look good. Glad we figured out the pending comments.

@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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 7, 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