# static isGreater()

## `Greater.isGreater()`

Checks whether the given [`value`](#undefined) is the [`Greater`](https://docs.angular-package.dev/range-1/greater) instance of any or given primitive value.

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

```typescript
public static isGreater<Value extends number>(
  value: any,
  greaterValue?: Value
): value is Greater<Value> {
  return (
    typeof value === 'object' &&
    value instanceof this &&
    (typeof greaterValue === 'number'
      ? value.valueOf() === greaterValue
      : true)
  );
}
```

{% endcode %}

### Generic type variables

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

A generic type variable indicates captured type of the supplied [`greaterValue`](#greatervalue-value) via the [return type](#return-type).

### Parameters

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

The value of [`any`](https://www.typescriptlang.org/docs/handbook/basic-types.html#any) type to test against the [`Greater`](https://docs.angular-package.dev/range-1/greater) instance.

#### `greaterValue:`[<mark style="color:green;">`Value`</mark>](#valueextendsnumber)

An optional value of generic type variable [`Value`](#valueextendsnumber) to check whether it's the primitive value of the given [`value`](#value-any).

### Return type

#### `Greater<`[<mark style="color:green;">`Value`</mark>](#valueextendsnumber)`>`

The **return type** is a [`boolean`](https://www.typescriptlang.org/docs/handbook/basic-types.html#boolean) resulting from its statement indicating the [`value`](#value-any) is the [`Greater`](https://docs.angular-package.dev/range-1/greater) object that takes the generic type variable [`Value`](#valueextendsnumber).

### 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-any) is the [`Greater`](https://docs.angular-package.dev/range-1/greater) instance of any or given [primitive value](#greatervalue-value).

## Example usage

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

// Define constant `id`.
const id = 390;

// Returns Greater {390} of Greater<390>.
const id390 = Greater.create(id);

// Returns `true`.
Greater.isGreater(id390);

// Returns `false`.
Greater.isGreater(id390, 381);

// Returns `true`.
Greater.isGreater(id390, 390);
```
