# getCurrentStep()

## `Range.prototype.getCurrentStep()`

The `getCurrentStep()` method returns the step of the range [value](https://docs.angular-package.dev/range-1/range/accessors/value).

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

```typescript
public getCurrentStep(): number | undefined {
  return typeof this.value === 'number'
    ? Math.floor(this.value / this.#step)
    : undefined;
}
```

{% endcode %}

### Return type

#### [<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 the step of [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) type, if range [value](https://docs.angular-package.dev/range-1/range/accessors/value) 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);

// Returns 3 of number | undefined.
range.getCurrentStep();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.angular-package.dev/range-1/range/methods/getcurrentstep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
