<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@easyops-cn/brick-next-pipes](./brick-next-pipes.md) &gt; [nullish](./brick-next-pipes.nullish.md)

## nullish() function

空值合并（`??`<!-- -->）。

 Logic

**Signature:**

```typescript
export declare function nullish<T, U>(value: T, defaultValue: U): T | U;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | T | 输入值。 |
|  defaultValue | U | 默认值。 |

**Returns:**

T \| U

当输入值是 `null` 或 `undefined` 时返回默认值，否则返回原输入值。

