Skip to content
Advertisement

ReactJS. How to sort through data and find equal value of name property to id and store the object in a variable

I have a database and I am trying to sort through the data in the database and find the one that has a name property equal to the id variable that I specified. The id variable works though I am having trouble sorting through and finding the name property equal to the id variable. This what I have tried:

JavaScript

I think the problem is assigning the value to the object or sorting through. I appreciate any responses.

Advertisement

Answer

Sorry. It was a dumb mistake. I did response => response.json forgetting the parenthsis.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement