Skip to content
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

feat(m4): add solution exe-006 two-word-random-password #3548

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

AlessandroVerzella
Copy link

No description provided.

@AlessandroVerzella
Copy link
Author

Added solutions and comments

// Check the conditions
if (
firstWordPassword.length >= 3 &&
firstWordPassword.length <= 7 &&

Choose a reason for hiding this comment

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

Why don't you perform this check on line 15/16 so that if the password is incorrect, it generates a valid one?
Even better, use a function to achieve this ;-)

firstWordPassword.length >= 3 &&
firstWordPassword.length <= 7 &&
secondWordPassword.length >= 3 &&
secondWordPassword.length <= 7 &&

Choose a reason for hiding this comment

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

Same suggestion line 17/18.

})
.catch((error) => {
console.log('The program is unable to open the file you indicated');
});

Choose a reason for hiding this comment

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

We can try to solve the problem and do some refactoring during the mentorship ;-)

@aleattene aleattene changed the title Solution/m4 006 feat(m4): add solution exe-006 two-word-random-password Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants