Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
abdishakoor-dev
left a comment
There was a problem hiding this comment.
Your explanation in 2-mandatory-debug/1.js is spot on: a + b never runs because it comes after return.
Four things before I can mark this Complete:
2-mandatory-debug/0.jsstill printsundefined. See my comment on line 19.2-cases.js: see my comment on line 18.time-format.jsd): see my comment on line 35.3-to-pounds.js: see my comment on line 25.
Add the Needs Review label again once you've pushed.
| // Finally, correct the code to fix the problem | ||
| // =============> write your new code here | ||
|
|
||
| /* function multiply(a, b) { |
There was a problem hiding this comment.
Your new code on lines 19 to 22 is correct. But it is inside /* */, so it never runs. The original code on lines 6 to 10 still runs. That is why the file still prints undefined.
You can check this yourself. In VS Code, right click 0.js in the file list on the left, and choose Open in Integrated Terminal. The terminal opens in the same folder as the file. Then run:
node 0.js
Please do the opposite, like in your other files: put the original code inside /* */, and take your new code out of it. Then run the command again. It should print The result of multiplying 10 and 32 is 320.
There was a problem hiding this comment.
Fixed now. It prints 320. Good.
| // Use the MDN string documentation to help you find a solution | ||
| // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase | ||
|
|
||
| function upperCaseMaker(str) { |
There was a problem hiding this comment.
Your function works: it gives THE_SUN_IS_SHINING. Only the name needs to change.
The name upperCaseMaker tells the reader that your function only makes the letters capital. But your function makes the letters capital and replaces spaces with _. That is called upper snake case (see line 4).
JavaScript already has a method called toUpperCase, which you use on line 19. If you use that name as inspiration, and knowing what upper snake case means, what would more appropriate function name that reflects what the function is actually doing? Please rename it, and update call on line 25.
There was a problem hiding this comment.
upperSnakeCaseMaker says both jobs now. Good.
There was a problem hiding this comment.
For next time: a name like toUpperSnakeCase would fit even better. It follows the same pattern as JavaScript's own toUpperCase, which you use on line 19: "to" plus what the string becomes. Other developers will recognise that pattern straight away. Your name is fine for this exercise, so no change is needed.
|
|
||
| // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer | ||
| // =============> write your answer here | ||
| // =============> 1, because that's the actual value assigned to the num parameter |
There was a problem hiding this comment.
d) asks you to explain your answer. "because that's the actual value assigned to the num parameter" only repeats the question. Where does the 1 come from?
Your answer to e) on line 38 already says it: remainingSeconds is 1. Please add that reason to d) as well.
There was a problem hiding this comment.
That's the reason. Good.
| return `£${pounds}.${pence}`; | ||
| } | ||
|
|
||
| console.log(toPounds("11000p")); |
There was a problem hiding this comment.
Good range of inputs on line 26, from 0p to 11000p. Line 6 asks you to call the function a number of times. Please turn these into calls, like line 25, so anyone who runs the file can see the results.
There was a problem hiding this comment.
Good, all six inputs run now.
abdishakoor-dev
left a comment
There was a problem hiding this comment.
All four are fixed, and every file prints the right output. Marking this Complete, well done.

Learners, PR Template
Self checklist
Task code
CYF-1053
Changelist
Completed all Sprint 3 coursework exercises (except stretch one).