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
Edit: This is for older versions now.
You can use the remove() method, eg.
window.deleteObject = function() { canvas.getActiveObject().remove(); }
jsfiddle