To implement a undo/redo functionality, I have constructed an array "`history`" that gets filled with the latest changes based on `canvas.on()` events. 

console.log dump:

```
History: 
(3) […]
​
0: Object { target: {…} } //first object added
​
1: Object { e: mouseup, target: {…}, transform: {…}, … } //first object modified
​
2: Object { target: {…} } //another object added
​
length: 3

```

To walk back the stack of changes, I wanted to use `history[step].target` which contains the modified object at this stage (`step`).

I now look for a method to overwrite an object in the object array of fabric.

The function `canvas.item(0)` gives the object at position 0 on the current canvas but how can I overwrite that object with a different object (from the `history[].target` array)?

Note: Solutions I found for a undo/redo are seemingly based on serializing the whole canvas into JSON and saving this into an array of JSONs. I didn't want to do this since it seems a bit unsophisticated to always serialize/unserialize the whole canvas with x objects in it just to undo a small change and the history contains many usefull informations about what was changed and on which object ect.

Note2: Of course I probably could just `canvas.remove(canvas.item(0))` and then `canvas.add(history[x].target)`, however this unfortunately messes up my object stack when there's more than one objects, as `canvas.item(1)` becomes `canvas.item(0)` and the reverted change now becomes `canvas.item(1)` (or 2, 3... ect depending on how many items on the canvas). When I then have like a list of objects displayed depending on their position in the object stack, this get's rearranged and could confuse the user.