Manchester| 25-ITP-Sep | Fithi Teklom| Sprint 2 | Coursework #869
Manchester| 25-ITP-Sep | Fithi Teklom| Sprint 2 | Coursework #869Fithi-Teklom wants to merge 29 commits intoCodeYourFuture:mainfrom
Conversation
…m/Module-Structuring-and-Testing-Data into acoursework/sprint-2
WeiTsungCheng
left a comment
There was a problem hiding this comment.
It's mostly correct, but some errors could be reconsidered.
There was a problem hiding this comment.
Great for fulfilling the requirement, but if the file path doesn't end with .txt but instead is /Users/mitch/cyf/Module-JS1/week-1/interpret/file, will const ext return a blank value?
There was a problem hiding this comment.
No const ext won't return a blank value. It will incorrectly return the entire filename.
There was a problem hiding this comment.
Yes, so it can be changed to return a blank value. This is because no filename extension was provided.
There was a problem hiding this comment.
Remove .padEnd(2, "0")
Will it affect the code?
There was a problem hiding this comment.
Removing .padEnd(2, "0") won't break the logic may change the output formatting in certain cases.
There was a problem hiding this comment.
- but may change the output formatting in certain cases.
There was a problem hiding this comment.
And the important thing is that variables don't start with number.
There was a problem hiding this comment.
- but may change the output formatting in certain cases.
Could you give an example that might have an impact?
There was a problem hiding this comment.
Ahh, removing .padEnd(2, "0") will not change the output for valid inputs, because paddedPenceNumberString is already guaranteed to be at least 3 characters long from .padStart(3, "0").
There was a problem hiding this comment.
Only Test One passed the test, indicating that the function formatAs12HourClock(time) needs to be changed.
There was a problem hiding this comment.
Sorry, I didn't notice your correct version was in the commented-out area. Your new version does indeed pass the test.
Self checklist