Birmingham | 26-ITP-Jan | Arunkumar Akilan | Sprint 1 | Structuring-and-Testing-Data Coursework/Sprint1#1017
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sprint-1/2-mandatory-errors/3.js
Outdated
| const cardNumber = "4533787178994213"; | ||
| const last4Digits = cardNumber.slice(-4); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
.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)).
There was a problem hiding this comment.
.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))
|
Please note that in CYF courses, the recommended way to inform the reviewer of your changes is to do both of the following:
|
|
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. |
|
Can you practice responding to inline comments in this PR?
The response do not need to be detailed. Do look up (e.g., ask AI) what's the common practice when responding toe inline comments in a PR. |
|
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. |
|
@illicitonion Resolved. It was a misunderstanding. The trainee was unware the responses were in "Pending" state. |
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 |
|
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
…On Sat, Mar 7, 2026 at 9:04 AM CJ Yuan ***@***.***> wrote:
*cjyuan* left a comment
(CodeYourFuture/Module-Structuring-and-Testing-Data#1017)
<#1017 (comment)>
@illicitonion <https://github.com/illicitonion> Can you step in on this
PR? I do not understand why @arunkumarakilan
<https://github.com/arunkumarakilan> keep changing the labels without
addressing my requests.
—
Reply to this email directly, view it on GitHub
<#1017 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BTZRSKFE2BI7WCBQCNSRLMD4PPQYLAVCNFSM6AAAAACV33ZZWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DAMJWGAZDGNZTGY>
.
You are receiving this because you were mentioned.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/1017/c4016023736@
github.com>
|
|
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. |
Sprint-1/2-mandatory-errors/3.js
Outdated
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| const last4Digits = Number(String(cardNumber).slice(-4)); | ||
| console.log(last4Digits); |
There was a problem hiding this comment.
Does your code output the value you expected ifcardNumber were 4533787178990001?
There was a problem hiding this comment.
no so now i only convert to string and slice it thanks
|
Changes look good. Glad we figured out the pending comments. |

Learners, PR Template
Self checklist
Changelist
This PR includes all my work for Sprint 1.
Completed exercises and explanations for:
Questions
No questions at this time.