Removing multiple objects on Fabric.js canvas <p>Struggling to remove multiple objects from the fabric canvas. Everything seems to be in working order but when the code runs it does not remove the multiple selected objects from the canvas. </p> <pre><code> service.deleteSelectedObject = function () { var selectedObject = service.canvas.getActiveObject(); var selectedMultipleObjects = service.canvas.getActiveGroup(); var data = {}; // get object id // get selected objects from canvas if (selectedObject) { data = { type: 'whiteboard::delete', id: selectedObject.id }; delete service.objectMap[selectedObject.id]; service.canvas.remove(selectedObject); } else { data = { type: 'whiteboard::delete', object: selectedMultipleObjects }; console.log(selectedMultipleObjects); selectedMultipleObjects._objects.forEach(function (object, key) { console.log(object); service.canvas.remove(object); }); } signalService.sendMessage(service.recipient, data); }; </code></pre> <p>I should point out that all of these console logs do pass what they should. As well as the problem is occuring in the else statement the first part of this code works how it should </p> <p>please let me know if you need any further information. </p>