Hello, I'm breaking my head on this logic and I can not solve it;
I have this code:
for(let i = 0; i < mensagemDeErroDoInput.length; i++)
{
if(statusInput[mensagemDeErroDoInput[i].nome] === true)
{
return mensagemDeErroDoInput[i].mensagem;
}
}
An IF within a FOR, very simple!
Imagine this: I have two types of parameters, one parameter returns bool and the other returns me an object;
return parameter bool, returns this: true;
return parameter object, return this: {valid: false};
These parameters are my error message references, that is, if my return parameter bool is true, then I return an error message.
And if my object return parameter is other than null, then I return an error message.
However, all my bool return parameters are automatically different from null. So I'm not able to do this validation inside my for.
Could someone please help me?
Thank you in advance ...