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