'use strict';

module.exports = function(object, property, defaultValue) {
  if (arguments.length < 3) {
    defaultValue = 0;
  }
  if (!object) {
    return defaultValue;
  }
  const value = object[property];
  if (value === undefined) {
    return defaultValue;
  }

  return value;
};

'use strict';
const get = require('lodash.get');

module.exports = function(object, property, defaultValue) {
  if (arguments.length < 3) {
    defaultValue = 0;
  }
  if (!object) {
    return defaultValue;
  }
  return get(object, property, defaultValue)
};

use lodash get for help get function