Find last matching object in array of objects

var fruit = fruits.slice().reverse().find(fruit => fruit.shape === currentShape);

Leave a Comment