-
Notifications
You must be signed in to change notification settings - Fork 19
Mohammed A #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Mohammed A #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mohammedalfakih-dev, thanks for your submission.In task-2 there is a simplication possible. Could you give it a try? The rest looks good. Actually, this duplication makes sense here.
task-1/leap-year.js
Outdated
| if (Number.isNaN(year) || year < 1 || year > 9999) { | ||
| console.log("Invalid year!"); | ||
| } else { | ||
| let isLeap = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Prefer
constoverletif the variable does not need to be changed.
| let isLeap = | |
| const isLeap = |
- Best practice for JavaScript is to indent by 2 spaces (you are using 4 spaces here).
task-2/login.js
Outdated
| errorMessage("Login blocked: Too many incorrect attempts."); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can return early from the function if there are too many incorrect attempts. By doing so, you can get rid of the else statement:
| errorMessage("Login blocked: Too many incorrect attempts."); | |
| } else { | |
| errorMessage("Login blocked: Too many incorrect attempts."); | |
| return; | |
| } | |
| const isAdmin ... |
|
hi, |
No description provided.