Hi there,
The code below does not seem to be good enough for the following challenge:
Having got the value of the weekly password stored in weeklyPass, update 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…
var weeklyPass = 'darlene';
var weekDay = 'monday';
var currentPass;
switch (weekDay) {
case 'monday':
console.log (weeklyPass+'mnd');
break;
case 'tuesday':
console.log(weeklyPass+'tsd');
break;
case 'wednesday':
console.log (weeklyPass+'wsdnsd');
break;
case 'thursday':
console.log (weeklyPass+'thrsd');
break;
case 'friday':
console.log (weeklyPass+'frd');
break;
case 'saturday':
console.log (weeklyPass+'strd');
break;
case 'sunday':
console.log (weeklyPass+'snd');
break;
default:
console.log('');
}
The error that I get is only that it it not up to the required standards, but I cannot figure out how I could do things differently.
Thanks
Diana