> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# getValueOrDefault()

- Package: [@gooddata/sdk-code-convertors](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-code-convertors/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-code-convertors/src/configs/utils.ts

**Signature:**

```typescript
export declare function getValueOrDefault<T>(value: T, defaultValue: T, type?: ValueType, undefinedAsDefault?: boolean): T | undefined;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| value | T |  |
| defaultValue | T |  |
| type | [ValueType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-code-convertors/sdk-code-convertors.valuetype/index.md) | _(Optional)_ |
| undefinedAsDefault | boolean | _(Optional)_ |

**Returns:**

T &#124; undefined
