> For the complete documentation index, see [llms.txt](https://brianbuccaneer.gitbook.io/rxjs-stats/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brianbuccaneer.gitbook.io/rxjs-stats/operators/throwunlessnumber.md).

# throwUnlessNumber

## Description

Emits an `Error` if any item in the `Observable` is `NaN` or of a type that isn't a JavaScript `Number` object.

## API

```
throwUnlessNum()
```

### Since

0.5

### Parameters

None

### Options

None

### Returns

None. (Throws error if a non-number value is encountered.)

## Examples

```javascript
import { throwUnlessNum } from '@buccaneer/rxjs-stats';​

const numbers = [
  0,
  1,
  'Muhahaha. I am not actually a number!',
  3,
  4,
  5
];

const output$ = from(numbers).pipe(
  throwUnlessNum()
);

output$.pipe(console.log, console.log);
// Output:
// 0
// 1
// Error
```
