-1
Hello, I’m cracking my head on this logic and I can’t seem to solve it;
I have that code:
for(let i = 0; i < mensagemDeErroDoInput.length; i++)
{
if(statusInput[mensagemDeErroDoInput[i].nome] === true)
{
return mensagemDeErroDoInput[i].mensagem;
}
}
An IF inside a FOR, very simple!
Think of it this way: 1-I have two types of parameters, one parameter returns me bool and the other returns me an Object;
return parameter bool, return me this: true;
return parameter Object, return me this: {Valid: false};
These parameters are my error message references, that is, if my bool return parameter is true, then I return an error message.
And if my Object return parameter is different from null, then I return an error message.
However, all my bool return parameters are automatically already different from null. So I’m not getting that validation inside my.
Could someone please help me??
Thank you in advance...
What do you call "bool parameter" and "Object parameter"? I found these nomenclatures confusing, and this makes it a little difficult to understand the question.
– Sam
Oh yes, I will edit my question, thus improving the reading. I appreciate the tip
– Guilherme Nunes
Those "return parameters" are the
mensagemDeErroDoInput[i].nome
? If they are not, what (is) are the respective variables/expressions that store them?– Victor Stafusa
Yes, that’s right! Then. One is Boolean, and the other I’m not sure, because I’m using typescript + angular and I can’t find the type of variable. But the return of this 'Object' is exactly as I showed above in the question
– Guilherme Nunes