0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>We added an else if alternative branch to the conditional statement, and now the bar changes color from red to yellow if the password is longer than 5 characters. But if the password is longer than 10 characters, then the bar should turn green. We were able to add another else if branch, but in this case else is enough.</p>
1
<p>We added an else if alternative branch to the conditional statement, and now the bar changes color from red to yellow if the password is longer than 5 characters. But if the password is longer than 10 characters, then the bar should turn green. We were able to add another else if branch, but in this case else is enough.</p>
2
<p>Imagine that the password is 11 characters long. In this case, both conditions will return false, and JavaScript will execute the instructions from the else branch.</p>
2
<p>Imagine that the password is 11 characters long. In this case, both conditions will return false, and JavaScript will execute the instructions from the else branch.</p>
3
if (passLength <= 5) { // The instructions are executed if the first condition is true } else if (passLength > 5 && passLength < 10) { // The instructions are executed if the second condition is true } else { // The instructions are executed if the both conditions are false }<p>Add a third branch to our conditional statement and make sure that the bar color changes from red to yellow and then from yellow to green.</p>
3
if (passLength <= 5) { // The instructions are executed if the first condition is true } else if (passLength > 5 && passLength < 10) { // The instructions are executed if the second condition is true } else { // The instructions are executed if the both conditions are false }<p>Add a third branch to our conditional statement and make sure that the bar color changes from red to yellow and then from yellow to green.</p>