demos/Collage/fabric.js
function(key, value) {
      if (typeof key === 'object') {
        for (var prop in key) {
          this._set(prop, key[prop]);
        }
      }
      else {
        if (typeof value === 'function') {
          this._set(key, value(this.get(key)));
        }
        else {
          this._set(key, value);
        }
      }
      return this;
    }
function(key, value) {
      if (typeof key === 'object') {
        for (var prop in key) {
          this._set(prop, key[prop]);
        }
      }
      else {
        if (typeof value === 'function') {
          this._set(key, value(this.get(key)));
        }
        else {
          this._set(key, value);
        }
      }
      return this;
    }
function ( key , value ) { if ( typeof key === 'object' ) { for ( var prop in key ) { this . _set ( prop , key [ prop ] ) ; } } else { if ( typeof value === 'function' ) { this . _set ( key , value ( this . get ( key ) ) ) ; } else { this . _set ( key , value ) ; } } return this ; }
Sets property to a given value
@method set
@param {String} name
@param {Object|Function} value
@return {fabric.Group} thisArg
@chainable
Sets property to a given value