Exercise javascript weekly password

Hi,
I’ve been on this question for hours and I don’t know what’s wrong!

Instructions

Having got the value of the weekly password stored in weeklyPass, update and print to the console the value of currentPass depending on the day of the week we are in. To know which day of the week it is simply access weekDay.

Remember that updating the password is appending the letters corresponding to the consonants present in the name of the current day of the week.

There are many ways of cracking this problem, but Elliot and the guys specifically asked for you to use a switch statement…

I’ve wrote this:
(the first 3 lines is from the exercise)

var weeklyPass = ‘darlene’;
var weekDay = ‘friday’;
var currentPass;

switch(weekDay) {

case "friday":
    (currentPass = weeklyPass + "frd");
    break;
case "saturday":
    (currentPass = weeklyPass + "strd");
    break;
case "sunday":
    (currentPass = eeklyPass + "snd");
    break;
    
case "monday":
    (currentPass = weeklyPass + "mnd");
    break;
    
   
case "tuesday":
    (currentPass = weeklyPass + "tsd");
    break;
    
case "wednesday":
    (currentPass = weeklyPass + "wdnsd");
    break;
    
case "thursday":
    (currentPass = weeklyPass + "thrsd");
    break;

}

console.log(currentPass);

ERROR
Output

Code is incorrect

Your code is producing the wrong output. The password stored in currentPass is incorrect! Be sure your code works for all possible outcomes.
can you please help with some advice? thank you so much !

It looks like there’s a typo in your second case – that’s likely hanging you up. If you fix that and still have trouble, please link to the tutorial so we can see the instructions to compare against your work. Hope this helps!

1 Like

oh my god, can’t believe I didn’t see it!!! thanks a lot ! :smiling_face_with_three_hearts:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.