Unit 4 Decision App Help

Link to the project or level: [(App Lab - Code.org)]
What I expect to happen: The code runs okay, but with an error.
What actually happens: We get the following error with a red square: “WARNING: Line: 28: setText() text parameter value (undefined) is not a uistring.
ERROR: Line: 28: TypeError: Cannot read properties of undefined (reading ‘toString’)”

We would like it to run without the error.

Hi, thanks for posting on the forum, this project has a good start! I took a look and see what the problem is–

When only one of the dropdowns has been selected, none of the if else statements have true conditions yet, and the Shoes variable is empty, so there is nothing for the setText to show.

There are several ways to fix this. One is to set the Shoes variable equal to an empty string at the top of the code where you declare it, like this:

var Shoes = “”;

Another way is to include an else statement in your conditional block that will assign a value to Shoes no matter what, like I did here:

Best,
Lindsay

Thanks so much, this is perfect! I really appreciate the help.