I want to modify an object in an array by calling array.find() and then mutate the returned reference to indirectly mutate the array but that doesnt appear to work. I assumed from reading other articles that array.find() returns a reference to an object in the array on a successful match but that appears not the be the case. In this
I am getting back the following array below and would like to show all the matched objects based off the matched strings. Returned Array: [“USA”, “FRA”, “GBR”] Original Array: My desired Output is to show the country that matches: JS: Answer One method to achieve this is to use reduce with includes.