Conversation
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
| const normalSearch = searchString.trim().toLowerCase(); | ||
| const normalTitle = bookTitle.toLowerCase(); | ||
|
|
||
| return normalTitle.includes(normalSearch); |
There was a problem hiding this comment.
You named variables very clearly, well done!
| if (!searchString) | ||
| return false; | ||
|
|
||
| const normalSearch = searchString.trim().toLowerCase(); |
There was a problem hiding this comment.
Nice that you handle extra white space at the beginning and the end of the search string, but what if the search string has an extra space in between words?
| @@ -1 +1,22 @@ | |||
| // Your code here | |||
| function parseDateString(dateString) { | |||
| const [format, datePart]= dateString.split(" ");//splet by space | |||
| function parseDateString(dateString) { | ||
| const [format, datePart]= dateString.split(" ");//splet by space | ||
|
|
||
| const [first, second, year]= datePart.split("-").map(Number); //seprator and number |
There was a problem hiding this comment.
Nice usage of map(Number)!
One thing is that the variable names first and second are not clear enough. It would be hard for future developers to tell what is first and what is second at first glance.
|
|
||
| const [first, second, year]= datePart.split("-").map(Number); //seprator and number | ||
|
|
||
| let day , month ; |
There was a problem hiding this comment.
Formatting is a little off. There is an extra white space before the comma and semi-colon.
| console.log(parseDateString("MDY 10-21-1983")); | ||
| console.log(parseDateString("DMY 21-10-1983")); | ||
| console.log(parseDateString("MDY 03-15-2024")); | ||
| console.log(parseDateString("DMY 15-03-2024")); |
There was a problem hiding this comment.
You handled all the requirements, well done!
| export function | ||
| convertSecondsToMinutes(seconds){ | ||
| return seconds/60 ; | ||
| } |
There was a problem hiding this comment.
You implemented all the requirements, but please pay attention to the code formatting.
It is a good practice
- to leave a space before and after an operator.
- to remove the space before the semicolon.
- keeping the function name on the same line with the
function
| printwindChill("Berlin",15,20); | ||
| printwindChill("Copenhagen",-5,25); | ||
| printwindChill("Cairo",30,10); | ||
| printwindChill("Istanbul",6,15); No newline at end of file |
There was a problem hiding this comment.
You used clear variable names and clear function names. And you implemented reusable functions in accordance with the separation of concerns principle; each function is responsible for one thing. Well done!
But your code doesn't work! Did you run this code? There are two small issues.
When you resolve those issues, you will see that your functions' output is not the same as the original file, and that is because of formatting the output. Pay attention to spaces and separators.
No description provided.