+ 1
Whats wrong with my code?[SOLVED]
In my code when a user clicks question a question is posed saying how may days are in a year , when yous insert 366 which is one of the correct answer it displays wrong yet it has to display correct , whereas if you insert 365 it displays correct which is also one of the answer expected. The Code is below. https://code.sololearn.com/WIQtuNbLI46m/?ref=app
4 Respostas
+ 1
Astron Daniel hi,
When you ask if(question===answer[ 0, 2 ])
I think it check every value in order and return the last checked.
You can try by swapping 366 by 365 and vice versa to see.
So the || operator as said by Aswajith K.K should solve that issue.
+ 4
Try using or operator(||)
+ 3
Thanks Aswajith K.K , Thanks EmmanueLZ i tried the operator and it worked