Conversation
This comment has been minimized.
This comment has been minimized.
mo92othman
left a comment
There was a problem hiding this comment.
Hi @YanaP1312, well done! 👍
Good job refactoring the code in Task 4. You show a good understanding of the DRY principle. Good luck in the next modules!
| const bookName = "The fundamentals of JavaScript".toLowerCase(); | ||
| const pureString = searchString.trim().toLowerCase(); | ||
|
|
||
| if(!pureString) return false; |
task-2/parse-date.js
Outdated
| const first = Number(date.substring(0, firstDash)); | ||
| const second = Number(date.substring(firstDash + 1, lastDash)); | ||
| const third = Number(date.substring(lastDash + 1)); |
There was a problem hiding this comment.
Nice, this works correctly 👍
You could also use split("-") here, which would make the code easier to read and maintain.
Minor note: more descriptive variable names (like day or month) can improve readability, but this is also fine at this stage.
There was a problem hiding this comment.
Thank for the suggestion, @mo92othman ! I updated the solution to use split("-") and pushed the changes. This approach also made it easier to destructure the values and assign them to object keys without repeating logic, so the code became cleaner and more maintainable.
| export const convertHoursToMinutes = hours => hours * 60; | ||
|
|
||
| export const convertMinutesToHours = minutes => minutes / 60; | ||
|
|
||
| export const convertDaysToHours = days => days * 24; | ||
|
|
||
| export const convertHoursToDays = hours => hours / 24; | ||
|
|
||
| export const convertMinutesToSeconds = minutes => minutes * 60; | ||
|
|
||
| export const convertSecondsToMinutes = seconds => seconds / 60; No newline at end of file |
task-4/cleanup.js
Outdated
| const part_1 = weatherReport(city, celsius); | ||
| const part_2 = windChillCalculation(city, celsius, speed); |
There was a problem hiding this comment.
Minor suggestions: use more descriptive variable names instead of part_1 and part_2 .
There was a problem hiding this comment.
Thanks! I changed it and pushed.
…ptive in task-2 & task-4
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
Done tasks for week-3