Student Stuck on project Hackathon Unit 5 lesson 17

(App Lab - _ Link to project

What he wants to happen:
Click Energy, then click the lightning bolt.

My student is trying to use the input result “Lightning” to populate the strength, weakness, and fusion for the 3 text boxes below the box containing the word lightning.

He wants that to automatically populate when you click any of the images above the lightning box. He’s only working on lightning now and will duplicate the code once it works properly.

He has created functions, assigned variables, etc.

Any ideas on how he can do that?

@rcoulon [Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]
Link to the project or level: [replace with link to the curriculum or get the “Share” link to a project]
What I expect to happen: [replace with a detailed description of the behavior you’re trying to create]
What actually happens: [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior]
What I’ve tried: [replace with a detailed description of what you’ve already tried to do to solve the problem]

In addition, Have your students look at the U5L10 Traversals Investigate, bubbles 5 & 6. These bubbles cover traversals using map, filter and reduce from a list.

He already has setText("elementNameEnergy", "Lightning"); so he does know where to update those additional text boxes.

He has a function called filter() to presumably find the values to put into those boxes. It will need to be called before filling in those boxes.

Unfortunately, he has this line of code if (element == (selectedElementP || selectedElementE)) { in the filter function. That doesn’t do what you think it does. Point to it and ask him to figure out what it really does do.

Other than that this is a good start and he just needs to keep going.

Thank you so much!!!