How do I replace objects in Collection1 with a matching object(by name and description) from Collection2?
Also the objects for the matching operation in Collection2 have to be within a certain range, say from 0-20. Objects with index > 20 in Collection2 need to be appended to Collection1.
This is one way:
It’s highly likely that the code can be improved even more, if your intentions were a little more clear. There may be a cleaner way if the problem was better understood.