You are viewing a single comment's thread. Return to all comments →
Simple Javascript solution using regex and filter method:
function minimumNumber(n, password) { return Math.max(6 - n, [/\d/, /[a-z]/, /[A-Z]/, /[^\s\w]/].filter((regex) => !regex.test(password)).length ); }
Return the highest number between the required length less actual length and the required characters.
Seems like cookies are disabled on this browser, please enable them to open this website
Strong Password
You are viewing a single comment's thread. Return to all comments →
Simple Javascript solution using regex and filter method:
Return the highest number between the required length less actual length and the required characters.