- We have two arrays of objects.
- Each object has an associated DOM element,
.el
. - The two arrays are sharing some objects, but not all of them;
- The two arrays have different orders for the shared objects.
- The first array's associated DOM elements are already inserted in the DOM, reflecting the owner objects' order in the array.
Now we want to replace the first array with the second one, with the following requirements:
- Update the DOM so that the inserted elements reflect the order of objects in the second array.
- Reuse any existing objects and DOM elements.