function coerceToBoolean(value) {
    var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    if (isNil(value)) {
      return defaultValue;
    }

    return Boolean(value);
  }
Converts the `value` to a boolean. If `value` is `undefined` or `null`, returns `defaultValue`.

@ignore
@function toBoolean
@param {*} value The value to convert.
@param {boolean} [defaultValue=false] The default value.
@return {boolean} Returns the coercion to boolean.