# static isNumber()

## `Number.isNumber()`

The static `isNumber()` method checks the provided [`value`](#value-any) of [`any`](https://www.typescriptlang.org/docs/handbook/basic-types.html#any) type whether is an instance of [`Number`](https://docs.angular-package.dev/range-1/number) of any or the given primitive [value](#numbervalue-value).

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

```typescript
public static isNumber<Value extends number>(
  value: any,
  numberValue?: Value
): value is Number<Value> {
  return (
    typeof value === 'object' &&
    value instanceof this &&
    (typeof numberValue === 'number' ? value.valueOf() === numberValue : 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 [`numberValue`](#numbervalue-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 [`Number`](https://docs.angular-package.dev/range-1/number) instance.

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

Optional number of the generic type variable [`Value`](#valueextendsnumber) to check if it's the [primitive value](https://docs.angular-package.dev/range-1/number/valueof#number.prototype.valueof) of the given [`value`](#value-any).

### Return type

#### `value is Number<`[<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 [`Number`](https://docs.angular-package.dev/range-1/number) 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 provided [`value`](#value-any) is an instance of [`Number`](https://docs.angular-package.dev/range-1/number) of any or the given [<mark style="background-color:purple;">`numberValue`</mark>](#numbervalue-value).

## Example usage

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


```
