> 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/has.md).

# has()

## `Range.prototype.has()`

The `has()` method checks whether the [`value`](#value-number) is in the range of a specified [`Range`](/range/overview.md) object.

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

```typescript
public has(value: number): boolean {
  return (
    (this.minLessThan(value) && this.maxGreaterThan(value)) ||
    value === this.min ||
    value === this.max
  );
}
```

{% endcode %}

### Parameters

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

The value 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)

### Returns

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

## Example usage

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

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

// Returns false.
range.has(3);

// Returns true.
range.has(4);

// Returns false.
range.has(28);

// Returns true.
range.has(27);
```
