!bug! code works just fine in vs code also confirmed with chatgpt

hi there, welcome to the forum.

Please take the time to read about how to ask a good question here:

You have an error in your console. Looks like the problem is some undeclared references to result. Try to look at the code and see if you can find them. (Hint: they are not in your function)