Skip to content

Conversation

@Yusuprozimemet
Copy link

Tasks are ready for review. thanks.

@remarcmij remarcmij self-assigned this Jan 21, 2026
Copy link

@remarcmij remarcmij left a comment

Choose a reason for hiding this comment

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

Hi @Yusuprozimemet, your PR looks good. One minor suggestion for task-1, but I will approve your PR now.

return (y % 4 === 0 && y % 100 !== 0) || (y % 400 === 0);
}
return null;
};

Choose a reason for hiding this comment

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

A function that starts with an is prefix is, by convention, expected to return a boolean. Your function however returns either a boolean or a null value. If you want to use functions for testing the year it would be better to create 2 functions, both returning booleans, each with a name that reflects their sole purpose.

  • One for testing whether the year is valid.
  • One for testing whether the year is a leap year.

For instance:

const isValidYear = (y) => y >= 1 && y <= 9999;

const isLeapYear = (y) => (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;

(username === correctUsername2 && password === correctPassword2)
) {
successMessage('Logged in successfully!');
incorrectAttempts = 0; // Reset on successful login

Choose a reason for hiding this comment

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

👍 for resetting the incorrect login count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants