I am trying to do a coding exercise and it asks me the following: "I defined the function sePoneLaOlla, which receives the string of the day of the week as a parameter. This function returns "Let's put the pot on, today we eat pasta!" if it receives by parameter the value "Sunday", otherwise it will return "Better we leave it for Sunday" "
Which I solved as follows
function sePoneLaOlla(Lunes){
if (sePoneLaOlla = Domingo) {
return "¡Pongamos la olla, hoy se comen pastas!";
} else (sePoneLaOlla = Lunes) {
return "Mejor lo dejamos para el domingo";
}
}
When executing it, it gives me an error and I don't know how else to formulate it.
==
You can also do it like this:
If only one part will be validated, there is no need to put the else.