src/back/models/attributes/Attribute.js
function getDefaultValue(entity) {
  expect(arguments).to.have.length(
    1,
    'Invalid arguments length when getting the default value of an Attribute ' +
    'to an Entity instance (it has to be given 1 argument)'
  );

  expect(entity).to.be.an.instanceOf(
    models.Entity,
    'Invalid type of argument "entity" when getting the default value of an ' +
    'Attribute to an Entity instance (it has to be an Entity)'
  );

  if (typeof this.default === 'function') {
    return this.default.call(entity);
  } else {
    return this.default;
  }
}
function getDefaultValue(entity) {
  expect(arguments).to.have.length(
    1,
    'Invalid arguments length when getting the default value of an Attribute ' +
    'to an Entity instance (it has to be given 1 argument)'
  );

  expect(entity).to.be.an.instanceOf(
    models.Entity,
    'Invalid type of argument "entity" when getting the default value of an ' +
    'Attribute to an Entity instance (it has to be an Entity)'
  );

  if (typeof this.default === 'function') {
    return this.default.call(entity);
  } else {
    return this.default;
  }
}
function getDefaultValue ( entity ) { expect ( arguments ) . to . have . length ( 1 , 'Invalid arguments length when getting the default value of an Attribute ' + 'to an Entity instance (it has to be given 1 argument)' ) ; expect ( entity ) . to . be . an . instanceOf ( models . Entity , 'Invalid type of argument "entity" when getting the default value of an ' + 'Attribute to an Entity instance (it has to be an Entity)' ) ; if ( typeof this . default === 'function' ) { return this . default . call ( entity ) ; } else { return this . default ; } }
Gets the default value of the current Attribute to a given Entity instance.
@name module:back4app-entity/models/attributes.Attribute#getDefaultValue
@function
@param {!module:back4app-entity/models.Entity} entity The Entity instance to
which the default value will be get.
@returns {boolean|number|string|Object|function} The default value.
@example
var defaultValue = MyEntity.attributes.myAttribute.getDefaultValue(
new MyEntity()
);
Gets the default value of the current Attribute to a given Entity instance .