Skip to content

Mareh A.#18

Open
mareh-aboghanem wants to merge 1 commit intoHackYourAssignment:mainfrom
mareh-aboghanem:main
Open

Mareh A.#18
mareh-aboghanem wants to merge 1 commit intoHackYourAssignment:mainfrom
mareh-aboghanem:main

Conversation

@mareh-aboghanem
Copy link

No description provided.

@github-actions
Copy link

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@mnvacym mnvacym self-assigned this Feb 1, 2026
const titleOfbook ="The fundamentals of JavaScript";

const titleLowerCase = titleOfbook.toLowerCase();
return titleLowerCase.includes(searchString.trim().toLowerCase());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good that you created a variable named titleLowerCase and assigned the logic to it. You could do the same for the search string. It is good practice to break logic into small chunks and assign them to variables so the code is more readable and easier for future developers to maintain. For example:

const normalizedBookTitle = bookTitle.toLowerCase();
const normalizedSearchString = searchString.trim().toLowerCase();

return normalizedBookTitle.includes(normalizedSearchString);

Also, what if I provide an empty string? Or what if I call the isBookApplicable function without a parameter? Or what if the search string has an extra space between words?

console.log(isBookApplicable(""));
console.log(isBookApplicable());
console.log(isBookApplicable("The fundamentals of                     JavaScript"));

That's why, in software engineering, it's very important to first consider all the requirements and error cases that need to be handled ("Error Handling").

return { day, month, year };
} else if (dateString.includes("DMY")) {
//Format: DD-MM-YYYY
const parts = dateString.split(" ")[1].split("-");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pay attention to the DRY principle.

const month = parts[1];
const day = parts[0];
const year = parts[2];
return { day, month, year };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that you handled all the requirements except returning values as numbers.

}
export function convertSecondsToMinutes(s){
return s / 60;
} No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You implemented all the requirements. One improvement would be to make your parameter names clearer. Please try to avoid using single letters for naming while programming. It might be hard for future developers to understand the code. Try to use clear naming.

console.log("Wind chill in " + cityName3 + ": " + windChill3.toFixed(2) + "°C"); No newline at end of file
weatherReport(cityName2, tempCelsius2, windSpeed2);
console.log("---");
weatherReport(cityName3, tempCelsius3, windSpeed3);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Your logic is correct; however, the outputs of your functions do not match the original file.

@mnvacym mnvacym added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants