* of 10 or more characters, includes at least one capital letter, and contains
* at least one non-alphanumeric character.
*
* @param {string} password - The password to be checked.
* @returns {boolean} - Returns true if the password is valid, otherwise returns false.
*/
function passwordChecker(password) {
const minLength = 10;
const capitalLetter = /[A-Z]/;
const nonAlphanumeric = /[^a-zA-Z0-9]/;
if (password.length >= minLength &&
capitalLetter.test(password) &&
nonAlphanumeric.test(password)) {
return true;
} else {
return false;
}
}
/**
* Checks if a password is valid. A password is considered valid if it has a length