> 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/draft/range/methods/isbetween.md).

# isBetween()

## `Range.prototype.isBetween()`

The `isBetween()` method checks whether range of the given [`min`](#min-number) and [`max`](#max-number) is between the range of a specified [`Range`](/draft/range/overview.md) object.

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

```typescript
public isBetween(min: number, max: number): boolean {
  return min <= max ? this.hasEvery(min, max) : false;
}
```

{% endcode %}

### Parameters

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

The **minimum** range of [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) type to test.

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

The **maximum** range of [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) type to test.

### Return type

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

### Returns

The **return value**  is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) type indicating whether the range of a specified [`Range`](/draft/range/overview.md) object is between a range of the given [`min`](#min-number) and [`max`](#max-number).

## Example usage

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

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

// Returns false.
range.isBetween(3, 26);

// Returns true.
range.isBetween(4, 27);

// Returns false.
range.isBetween(5, 28);
```
