London | 26-ITP-May | Chun Yan Wong | Sprint 1 | CourseWork#1466
London | 26-ITP-May | Chun Yan Wong | Sprint 1 | CourseWork#1466cywong-dev wants to merge 18 commits into
Conversation
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Could you also format the checkboxes (in the self checklist) so that they looks like this:
instead of like this: [X] I have tested my changes For more info, see; https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/about-tasklists |
Yes, done |
Convert cardNumber to string before slicing to ensure proper extraction of last 4 digits.
| // There is no -4 starting position and hence it will not work | ||
|
|
||
| const last4Digits = cardNumber.slice(cardNumber.length - 4) | ||
| const last4Digits = cardNumber.toString().slice(cardNumber.toString().length - 4) |
There was a problem hiding this comment.
.slice() accepts negative index. .slice(-4) would be enough in this example
| // Create a variable to store the ext part of the variable | ||
|
|
||
| const dir = filePath.substring(0, url.lastIndexOf("/") + 1);; | ||
| const dir = filePath.substring(0, filePath.lastIndexOf("/") + 1);; |
There was a problem hiding this comment.
I think it should not contain a trailing / for file directory
Have you checked if the value assigned to dir meets your expectation?
Learners, PR Template
Self checklist
Changelist
Complete the coursework for sprint 1 in the module Structuring and testing data