Skip to content

Instantly share code, notes, and snippets.

@khayyamsaleem
Created November 5, 2016 18:17
Show Gist options
  • Save khayyamsaleem/40dcdf7b46c0d91975237d1f2022ed2a to your computer and use it in GitHub Desktop.
Save khayyamsaleem/40dcdf7b46c0d91975237d1f2022ed2a to your computer and use it in GitHub Desktop.
function isPasswordValid (input) {
if(!hasUppercase(input)) {
console.log('You need a capital letter');
}
if (!hasLowercase(input)) {
console.log('Password needs a lowercase letter');
}
if (!isLongEnough(input)) {
console.log('Password needs to be longer.');
};
if (hasUppercase(input) && hasLowercase(input) && isLongEnough(input)) {
console.log('Password is valid');
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment