-
-
Notifications
You must be signed in to change notification settings - Fork 241
ITP-JAN2025-London|Sabita-Shrestha|Module-Structuring-and-Testing-Data|Week6|2sprint #277
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
ITP-JAN2025-London|Sabita-Shrestha|Module-Structuring-and-Testing-Data|Week6|2sprint #277
Conversation
cjyuan
left a comment
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.
I think you understand the code but some of your explanations are not quite correct or have grammar mistake. I would suggest trying ChatGPT more often.
I left you some suggestions.
Feel free to mark this as completed after you make the necessary changes.
| console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); | ||
|
|
||
| // =============> write your explanation here | ||
| // =============> write your explanation here: function will be undefined because of ";" by removing ; placing a+b in same line will return function. |
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.
Between "return value" and "function", which one is undefined?
Sprint-2/2-mandatory-debug/2.js
Outdated
| // =============> write the output here: 3 for all console.log. | ||
| // Explain why the output is the way it is | ||
| // =============> write your explanation here | ||
| // =============> write your explanation here: 3 for all of the the console.log because it won't take any argument it will always take const argument. |
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.
It has nothing to do with const.
May I suggest asking ChatGPT "How does the identifier resolution work in Javascript?".
| const text = `hello there`; | ||
| console.log(text.toUpperCase()); | ||
|
|
||
| const sentence = `lord of the rings`; | ||
| console.log(sentence.toUpperCase()); |
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.
Your code does not yet satisfy the requirement. Can you reread what the spec ask for exactly?
| function toPounds(penceString){ | ||
| const penceStringWithoutTrailingP = penceString.substring( | ||
| 0, | ||
| penceString.length - 1 | ||
| ); | ||
|
|
||
| const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); | ||
| const pounds = paddedPenceNumberString.substring( | ||
| 0, | ||
| paddedPenceNumberString.length - 2 | ||
| ); | ||
|
|
||
| const pence = paddedPenceNumberString | ||
| .substring(paddedPenceNumberString.length - 2) | ||
| .padEnd(2, "0"); | ||
| return `${pounds}.${pence}`; | ||
| } |
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.
If you are using VSCode to edit the code, your can right-click the editor and select "Format Document" to ident the code to make the code easier to read.
| console.log(`The last digit of 399p is ${toPounds("399p")}`); | ||
| console.log(`The last digit of 52p is ${toPounds("52p")}`); | ||
| console.log(`The last digit of 1099p is ${toPounds("1099p")}`); |
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.
Does the function toPounds() return the last digit of the given parameter?
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.