Open History to see the last commit
1---
2id: extractValue
3title: extractValue
4---
5
6# Function: extractValue()
7
8```ts
9function extractValue(expr): any;
10```
11
12Defined in: [packages/db/src/query/expression-helpers.ts:127](https://github.com/TanStack/db/blob/main/packages/db/src/query/expression-helpers.ts#L127)
13
14Extracts the value from a Value expression.
15Returns undefined for non-value expressions.
16
17## Parameters
18
19### expr
20
21`BasicExpression`
22
23The expression to extract from
24
25## Returns
26
27`any`
28
29The extracted value
30
31## Example
32
33```typescript
34const val = extractValue(someExpression)
35// Returns: 'electronics'
36```