how to get data by id in array code example Example: javascript get array object by id myArray.find(x => x.id === '45').foo;