> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/range-1/range/methods/getcurrentrange.md).

# getCurrentRange()

## `Range.prototype.getCurrentRange()`

The `getCurrentRange()` method returns a range of numbers from [minimum](/range-1/range/properties/min.md) to the current [`value`](/range-1/range/accessors/value.md) by the [`step`](/range-1/range/accessors/get-step.md) of a specified [`Range`](/range-1/range/overview.md) object.

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

```typescript
public getCurrentRange(): Readonly<Array<number>> | undefined {
  return typeof this.value === 'number'
    ? this.getRange(this.value)
    : undefined;
}
```

{% endcode %}

### Return type

#### [<mark style="color:green;">`Readonly`</mark>](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype)`<`[<mark style="color:green;">`Array`</mark>](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#arrays)`<`[<mark style="color:green;">`number`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#number)`>> |`[<mark style="color:green;">`undefined`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#null-and-undefined)

### Returns

The **return value** is a range of numbers of a read-only [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) from [minimum](/range-1/range/properties/min.md) to the current [`value`](/range-1/range/accessors/value.md), if the current [`value`](/range-1/range/accessors/value.md) is set, otherwise [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined).

## Example usage

```typescript
// Example usage.
import { Method } 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);

// Get entire range.
// Returns (9) [3, 6, 9, 12, 15, 18, 21, 24, 27]
range.range;

// Returns (3) [3, 6, 9]
range.getCurrentRange();
```
