---
title: "init(forConstantValue:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsexpression/init(forconstantvalue:)"
---

# init(forConstantValue:)

Creates an expression that represents a specified constant value.

## Declaration

```swift
init(forConstantValue obj: Any?)
```

## Parameters

- `obj`: The constant value the new expression is to represent.

## Return Value

Return Value A new expression that represents the constant value, obj.

## See Also

### Creating an Expression for a Value

- [expressionForEvaluatedObject()](foundation/nsexpression/expressionforevaluatedobject().md)
- [init(forKeyPath:)](foundation/nsexpression/init(forkeypath:)-1aqf5.md)
- [init(forVariable:)](foundation/nsexpression/init(forvariable:).md)
- [init(forKeyPath:)](foundation/nsexpression/init(forkeypath:)-98by.md)
- [expressionForAnyKey()](foundation/nsexpression/expressionforanykey().md)
