Find object by id in an array of JavaScript objects
Use the find() method: From MDN: The find() method returns the first value in the array, if an element in the array satisfies the provided testing function. Otherwise undefined is returned. If you want to find its index instead, use findIndex(): From MDN: The findIndex() method returns the index of the first element in the … Read more