Is there a smarter way to write this this javasript? I feed in a parameter called “animalType” that changes depending on the new animal brought it. Would it be possible to destructure the object but save the changes?
animalDiscoveryList[animalType].points += currAnimal.points
animalDiscoveryList[animalType].owned += currAnimal.owned
.....
animalDiscoveryList[animalType].foodTypes = animalDiscoveryList[selectedFilterType].foodTypes.append(currAnimal.id)