#nameOf
Returns the name of the property currently being iterated by a loop variable.
#nameOf(@loopVariable)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
@loopVariable |
variable |
A #foreach variable iterating an object. |
Returns
Section titled “Returns”string
Examples
Section titled “Examples”Keep original property names
Section titled “Keep original property names”"#foreach(@x in $.someObject) into 'result'": [ { "#nameOf(@x)": "@x" } ]