# valueDown()

## `Range.prototype.valueDown()`

The `valueDown()` method decrements the range [value](https://range.angular-package.dev/range/accessors/value) of a specified [`Range`](https://range.angular-package.dev/range) object by the range [step](https://range.angular-package.dev/range/accessors/get-step) or given [`stepDecrement`](#stepdecrement-number).

{% code title="range.class.ts" %}

```typescript
public valueDown(stepDecrement = 1): this {
  typeof this.value === 'number' &&
    stepDecrement > 0 &&
    this.setValue(this.value - stepDecrement * this.#step);
  return this;
}
```

{% endcode %}

### Parameters

#### `stepDecrement:`[<mark style="color:green;">`number`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#number)

The optional `stepDecrement` parameter of the [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) type decrements the range [`value`](https://range.angular-package.dev/properties/value#range.prototype.value). If no parameter is passed, `stepDecrement` defaults to **`1`**.

### Return type

#### [<mark style="color:green;">`this`</mark>](https://range.angular-package.dev/range)

### Returns

The **return value** is the [`Range`](https://range.angular-package.dev/range) instance.

## Example usage

```typescript
// Example usage.
import { Range } from '@angular-package/range';

// Create new instance.
// Returns Range {min: 3, max: 27, value: 10} of Range<3, 27, 3>.
const range = new Range(3, 27, 10, 3);

// Returns 10.
range.value;

// Returns 7.
range.valueDown().value;

// Returns 4.
range.valueDown(1).value;
```
