Skip to content

Hassan A. - #2

Open
ElevenEight118 wants to merge 5 commits into
HackYourAssignment:mainfrom
ElevenEight118:main
Open

ElevenEight118 wants to merge 5 commits into
HackYourAssignment:mainfrom
ElevenEight118:main

Conversation

@ElevenEight118

Copy link
Copy Markdown

No description provided.

@RHSebregts RHSebregts left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi!

Thank you for your assignment. There are some small details that could be fixed, please do so. But good work so far!

Thank you!

Comment thread task-1/leap-year.js Outdated
Comment on lines +6 to +16
if (year >= 0 && year <= 9999) {
if (year % 400 === 0) {
console.log(`Yes, year ${year} is leap`);
} else if (year % 4 === 0 && year % 100 !== 0) {
console.log(`Yes, year ${year} is leap`);
} else {
console.log(`No, year ${year} is not leap`);
}
} else {
console.log("Invalid year");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Putting an entire block into an if is considered bad practice. It can lead to what we call nested-ifs which makes it very hard to reach. Please try and prevent that if possible, your readers will thank you!

Comment thread task-1/leap-year.js Outdated

let year = Number(prompt("Enter year:"));

if (year >= 0 && year <= 9999) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When running this code, 0 is a leap year!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I changed the code to avoid integer numbers.

Comment thread task-1/leap-year.js Outdated

if (year >= 0 && year <= 9999) {
if (year % 400 === 0) {
console.log(`Yes, year ${year} is leap`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure you can say "x is leap"!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The grammatical error has been fixed.

Comment thread task-2/login.js Outdated
Comment on lines +9 to +10
if (username === "admin" && password === "Hack1234" ||
username === "user" && password === "7654321"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reading this statement is somewhat hard, because the grouping is not entirely clear, it almost seems like we can have password === "Hack1234" || username === "user". Could you group these statements a bit more?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have placed parentheses around each user to make them easier to read.

Comment thread task-3/converter.js

// Exchange rate for EUR/USD (How much 1 EUR is in USD)
const EUR_USD_RATE = 1.1643;
const EUR_USD_RATE = 1.118;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why did you update this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As there were no comments regarding this section, I opted to verify the exchange rate used during the development of converter.js and align it accordingly.

@RHSebregts RHSebregts added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels Nov 18, 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