-1
Hi, can you help me with this mistake? I’m taking an introductory Javascript course on an online teaching platform, and I’m having a problem in an exercise that asks:
First of all we need to know that a bank is closed when it is weekend (Saturday or Sunday) and is not in bank hours (9 to 15hs).
Set the function possibleIrAoBanco which, receive two parameters, the first is diaDaSemana (string) and the second timeAtual(number), the function must return true, only if the database is open.
Remember that you can do what is needed using Return without using if/Else.
This platform ends up having some demands that even though I am very early I can see are a little unnecessary. My code is like this:
function possoIrAoBanco(diaDaSemana, horaAtual) {
var domingo = "domingo";
var segunda = "segunda-feira";
var terca = "terça-feira";
var quarta = "quarta-feira";
var quinta = "quinta-feira";
var sexta = "sexta-feira";
var sabado = "sábado";
return diaDaSemana != sabado || diaDaSemana != domingo && diaDaSemana == segunda || diaDaSemana == terca || diaDaSemana == quarta || diaDaSemana == quinta || diaDaSemana == sexta && horaAtual < 15 && horaAtual > 9;
}
The error that appears is:
What could be wrong?
Yeah, that platform unravels instead of teaching, we get it.
– Maniero
Unfortunately... but you can help me with this mistake?
– Deb