Skip to content

Conversation

@Barboud
Copy link

@Barboud Barboud commented Jan 20, 2026

No description provided.

@Barboud Barboud changed the title S.R.S Ba-rabuod Salem Ba-rabuod Jan 27, 2026
Copy link

@rafaelhdr rafaelhdr left a comment

Choose a reason for hiding this comment

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

Great code. Easy to read, and everything is working great. Congrats 👏


if ( isNaN(year) || (year > 9999) || (year < 1)) {
console.log('Invalid year!');
} else {

Choose a reason for hiding this comment

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

It is great. I have one suggestion, that was not really necessary, but might make the code more clean.

Here is the explanation of early return: https://medium.com/swlh/return-early-pattern-3d18a41bba8

This is small code, so that is fine. But when the code starts growing, you can return things early, and the code is easier to read.

@rafaelhdr rafaelhdr self-assigned this Jan 30, 2026
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