-
-
Notifications
You must be signed in to change notification settings - Fork 195
London | ITP-May-2025 | Surafel Workneh | Structuring and testing data | Coursework/sprint 1 #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…gnment sprint -1 of 1-count.js
…m number generation in sprint -1 of 4-random.js
…'let' in sprint -1 of 1.js
…licing in sprint -1 of 3.js
…ons in sprint -1 of 4.js
…reassignment in percentage change calculation
…sprint -1 of 2-time-format.js
and describe the purpose in sprint -1 of 3-to-pounds.js
… sprint -1 of chrome.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkboxes in the PR descriptions are not in proper markdown syntax. Can you fix their markdown syntax? (I fixed one of them for you so that you can follow the example).
// 1. const penceString = "399p": initialize a string variable with the value "399p" | ||
//2. Removes the trailing "p" from the string: and result will be 399 | ||
//3. Ensures the number has at least 3 digits by padding from the left with zeros: like 000 | ||
//4. Extracts the pound portion: "3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we expect this program to work as intended for any valid penceString
if we deleted .padEnd(2, "0")
(line 16) from the code?
In other words, do we really need .padEnd(2, "0")
in this script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it can work without '.padEnd(2, "0") (line 16) from the code? ' and I tested with different digits and it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to delete .padEnd(2, "0")
. It's a "code reading" practice.
More importantly, do you know why the script can still works correctly without .padEnd(2, "0")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why the script can still works correctly without .padEnd(2, "0")
?
CJ would you mind if you check revisions please? |
What is the return value of `prompt`? | ||
Shows input dialog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the value returned by prompt()
?
The function returns different values depending on whether the user clicks the OK button or the Cancel button.
// 1. const penceString = "399p": initialize a string variable with the value "399p" | ||
//2. Removes the trailing "p" from the string: and result will be 399 | ||
//3. Ensures the number has at least 3 digits by padding from the left with zeros: like 000 | ||
//4. Extracts the pound portion: "3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why the script can still works correctly without .padEnd(2, "0")
?
Learners, PR Template
Self checklist
Changelist
Briefly explain my PR.
Function Parameter and Return Handling
String Manipulation and Formatting
Time Conversion Logic
Testing and Debugging
Questions
Ask any questions you have for your reviewer.