/passwordValidator.js Secret
Created
April 2, 2017 01:49
Star
You must be signed in to star a gist
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//rules one upper, one lower, 8 long and one special | |
//5 functions | |
//function 1 | |
function isPasswordValid(input) { | |
if(!hasUppercase(input)) { | |
console.log ('Password Valid'); | |
} | |
//function 2 | |
function hasUppercase(input) { | |
for(var i=0; i<input.length; i++) { | |
if (input[i]===input[i].toUpperCase){ | |
return true; | |
} | |
} | |
} | |
} | |
//final input | |
isPasswordValid('Weed'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment