$let
The$let operator declares a variable in the current scope.
Input
- An array containing exactly two values: the variable name (string) and the value to assign to the variable
Output
- The assigned value
Examples
Basic Variable Assignment
42
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
$let operator declares a variable in the current scope.
{
"$let": [
"x",
42
]
}
42
{
"$let": [
"user_name",
{
"$input": "name"
}
]
}
{
"$block": [
{
"$let": [
"total",
{
"$add": [
{
"$input": "price"
},
{
"$multiply": [
{
"$input": "price"
},
0.1
]
}
]
}
]
},
{
"$var": ["total"]
}
]
}
