[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustExist](./js-utils.mustexist.md)
## mustExist() function
Assert that a variable is not nil and return the value.
Signature:
```typescript
export declare function mustExist(val: Optional): T;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| val | [Optional](./js-utils.optional.md)<T> | |
Returns:
T
val
## Exceptions
NotFoundError