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

Home Work 2 done #1

Closed
wants to merge 2 commits into from
Closed

Conversation

alanchen8647
Copy link

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 👷 Optimization
  • 📝 Documentation Update
  • 🔖 Release
  • 🚩 Other

Description

This PR [adds/removes/fixes/replaces] this [feature/bug/etc].

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 readme
  • 📜 contributing.md
  • 📓 docs
  • 📕 storybook
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@alanchen8647 alanchen8647 changed the title homework done Home Work 2 done Aug 10, 2024
Comment on lines +28 to +41
let SpecialChars = /[!@#$%^&*.?]/;
let UpperLetter = /[a-z]/;
let LowerLetter = /[A-Z]/;
let Num = /[0-9]/;
if(password.length>9&&password.length<65){
if(password.search(SpecialChars)!=-1){
if(password.search(UpperLetter)!=-1 || password.search(LowerLetter)!=-1){
if(password.search(Num)!=-1){
return true;
}
}
}
}
return false;
Copy link
Member

Choose a reason for hiding this comment

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

This code is correct, but for clarity in more complex code, consider using if-statement guard clauses like in this example: https://github.com/CUNYTechPrep/js-summer-prep-2024/blob/main/session-01/validators.solution.js#L10-L16

@medgardo
Copy link
Member

@medgardo medgardo closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants