Sign in
Log inSign up

What is this snippet doing??

Aakash Mallik's photo
Aakash Mallik
·Dec 11, 2017

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);
  }