I have a student getting the error, “WARNING: Line: 39: setText() text parameter value (undefined) is not a uistring.ERROR: Line: 39: TypeError: Cannot read properties of undefined (reading ‘toString’)”I’m not sure why all of them are getting the error. Can you help?
Here is your first clue:
What does the dogs function do? Why does it need to use the size variable in some way?There is an attempt to not need size. We have if (breedGroupList[i] == "toy") {
. Let’s try an experiment.
“Toy” and “toy” are not equal. Which one of those two is in the database?
For your second clue let’s try some simple code:
Now let’s run it:
We get undefined. Does that sound familiar at all?
Recap those two clues. Trying to get something from an empty array returns undefined
. “toy” is not in the database. What is wrong?
Once I changed it to “Toy” it worked. Thanks.