-2
I need to know where the error is in the following function:
function quantidadeDeMesesComLucro(umPeriodo) {
let quantidade= ????;
for (let mes=0; mes< umPeriodo.length; mes++) {
????
}
return quantidade;
}
I tried to complete, but I can’t, follow my code:
function quantidadeDeMesesComLucro(umPeriodo) {
let quantidade= 0;
for (let mes=0; mes< umPeriodo.length; mes++) {
quantidade = umPeriodo[mes]
}
return quantidade;
}
This is a question of an exercise and I can’t figure out the mistake, someone can help me?
Your question seems to have some problems and your experience here in Stack Overflow may not be the best because of this. We want you to do well here and get what you want, but for that we need you to do your part. Here are some guidelines that will help you: Stack Overflow Survival Guide in English.
– Augusto Vasques
it’s hard to know the error when we don’t know the purpose.
– André Martins
What kind of error do you refer to? Error that appears on the console or is simply not running correctly? " quantity = one month[month]" should be "quantity += one month]"
– André
the exercise only asks to complete the function, so I could not :(
– Thiago