课程: Level Up: JavaScript

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Password strength

Password strength

(electronic chiming) - Regular expressions or regex are sequences of characters that define a pattern in a string. We can use regular expressions to do things like remove certain characters in a string, or check whether a string matches a set of criteria. In this challenge, you'll build a password validator for a signup form which tests whether or not a user's desired password is strong enough. You must use a regular expression in your solution. If the user's password is strong enough, return the string, your password is valid. Otherwise, return the string, your password is invalid. You must also use a ternary operator to return a boolean value. Ternary operators check to see if a certain condition has been met. We follow the expression we want to check with a question mark, and if the condition is truthy, it will execute the code following the question mark. The truthy expression is followed by a colon and…

内容