function addValueToArray(arr, value) {
  const result = [].concat(arr);
  if (result[0] > value) {
    result[0] = value;
  }
  if (result[result.length - 1] < value) {
    result[result.length - 1] = value;
  }
  return result;
}
Add zero to the domain.
@param {Array} arr Add zero to the domain.
@param {Number} value Add zero to domain.
@returns {Array} Adjusted domain.