> For the complete documentation index, see [llms.txt](https://range.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://range.angular-package.dev/range/methods/valueof.md).

# ⚠ valueOf()

## `Range.prototype.valueOf()`

{% hint style="danger" %}
**Deprecated**: This feature is no longer recommended. Avoid using it, and update existing code if possible. Be aware that this feature may cease to work at any time.
{% endhint %}

The `valueOf()` method returns a read-only object consisting of the primitive values of [`Minimum`](/minimum/overview.md) and [`Maximum`](/maximum/overview.md) instances.

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

```typescript
public valueOf(): Readonly<{ min: Min; max: Max }> {
  return Object.freeze({
    min: this.#minimum.valueOf(),
    max: this.#maximum.valueOf(),
  });
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Readonly`</mark>`<{ min:`[<mark style="color:green;">`Min`</mark>](/range/generic-type-variables.md#minextendsnumber)`; max:`[<mark style="color:green;">`Max`</mark>](/range/generic-type-variables.md#maxextendsnumber)`; }>`

The **return type** is the [`Readonly`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype) object consisting of property `min` of a generic type variable [`Min`](/range/generic-type-variables.md#minextendsnumber) and a `max` of generic type variable [`Max`](/range/generic-type-variables.md#maxextendsnumber).

### Returns

The **return value** is a frozen [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) consisting of the primitive values of [`Minimum`](/minimum/overview.md) and [`Maximum`](/maximum/overview.md) instances.&#x20;

## Example usage

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

// Create new instance.
const range = new Range(4, 27);

// Returns Readonly<{ min: 4; max: 27; }>
range.valueOf();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://range.angular-package.dev/range/methods/valueof.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.
