dimanche 22 avril 2018

How can I get one alert via if operator only ? (just started JavaScript learning)

Here the part of code from the book "Beginning JS 4th edition". When I load it in a browser that will show me 2 times alerts, because I entered 2 NaNs in array. I'd like displaying alert just one time always, how can I get that knowing only if operator?

if (isNaN(degFahren[loopCounter]))

{ 
alert ("You have text parameters that will be skipped");
continue;
} 

I understand that loop have to run only one time inside @if block, but can't realize that((( Thank you!!!

Aucun commentaire:

Enregistrer un commentaire