Question: * Problem 5 : Password Strength Checker * * We want to make it as easy as possible for users to create secure passwords. *
Problem : Password Strength Checker
We want to make it as easy as possible for users to create secure passwords.
To do this, we want to build a simple password strength checker that will
tell us if a password is strong enough.
Write a function, checkPasswordStrength that accepts a password string
and returns the score of the password based on the following rules:
At least characters long.
Contains at least one uppercase letter
Contains at least one lowercase letter.
Contains at least one digit.
Depending on how many of the above rules are met, the score will be
or
if the type of value is not a string, return null
@param string value a string containing the password to be checked
@returns number a number between and inclusive
function checkPasswordStrengthvalue
Replace this comment with your code...
function checkPasswordStrengthvalue
if typeof value 'string'
return null;
let score ;
Rule : Check length
if valuelength
score;
Rule : Check for uppercase letter
if AZtestvalue
score;
Rule : Check for lowercase letter
if aztestvalue
score;
Rule : Check for digit
if dtestvalue
score;
return score;
Problem : Password Strength Checker for any number of password strings
You are asked to score password strength in a list using your
checkPasswordStrength function from problem
Where checkPasswordStrength takes a single password string, the passwordStrengthChecker
function takes a list of any number of password strings, parses them,
filters out any invalid ones, and creates a list.
For example: given the following strings, "asd and zdSsddS
a new list would be created of the following form
Notice how the list has been enclosed in square brackets, and each
score is separated by a comma and space.
The passwordStrengthChecker function can take any number of arguments, but they must all
be strings. If any of the values can't be parsed by checkPasswordStrengthie if
it returns null skip the value. For example:
passwordStrengthCheckerasdzdSsddS should return
and skip the invalid value.
@param number arguments any number of string duration arguments can be passed
@returns string
function passwordStrengthCheckervalues
Replace this comment with your code...
give solution as its written in question that its connected to problem so give solution of both problems
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
