I have a simple fabric js based application where I will let users add shapes connect them and animate them.
Following is my JS
var canvas; window.newA
Delete all selected objects:
canvas.getActiveObjects().forEach((obj) => { canvas.remove(obj) }); canvas.discardActiveObject().renderAll()