I have this code:
var id = event.target.getAttribute('id');
var matchedItem = ko.utils.arrayForEach(self.ProductEffectImagesToMatch(),
function(item) {
if (item.index == id) {
return item;
}
}
);
I want to get the item by index
in the array, if index
matches the id
then return the item.
How can that be done correctly?