What is this snippet doing??
JavaScript code... Don't really know what is happening here...
extend(obj, id) {
obj.toObject = (function(toObject) {
return function() {
return fabric.util.object.extend(toObject.call(this), {
id: id
});
};
})(obj.toObject);
}