Computer skips over checking the if on line 51

**Link to the project or level: App Lab -
What I expect to happen: should randomly display a random string from the list foodSummaryList when checkbox to ignore is checked
What actually happens: computer skips over checking the if on line 51 so it doesnt work
What I’ve tried: I ran the app slow to see which conditions were checked and for whatever reason the computer completely skips checking if Random == “true” which it is when the check bx is checked so it should work but since it skips checking that condition it doesnt work… i dont know why its skipping checking that condition

Hi, there. Is this a classroom project? Is this for the Create Task?

Greetings @yanet.cabrera,

regaurding your problem comparing a boolean to a string value is a very very bad idea (it’ll skip no matter what else you change since it’s regarded as false), you can also put this in the console and see what i did. additionally your if else tree looks very messy, if you want to keep the structure of where random is without it changing on you you’ll also need a return statement… anyways i should be able to help more once i get confirmation from @rossiai 's question anyways hope this helps!

1 Like

classroom project, not the Create task

oh! duh, I didn’t even catch that… of course “true” is not going to equal true… string doesnt equal boolean, thanks thats all I needed!

and yes, this isnt for the Create

Hi, there. Besides that, I would change the type of input you are using for the foodTypeDrop dropdown menu. If you use change, instead of click, the output will show immediately.

1 Like