Forum Discussion
I think I understand now… Take a look at the Object Literal documentation where it mentions some of the variables that you can use to reference other parts of a nested literal. I think probably want to use __root__ for your situation.
Maybe something like the following (I haven’t tried it out):
{
value: 42,
child: {
adder: x => __root__.value + x
}
}
thanks @tstack .This was the exact use case.
Also do we have a total number of libraries we can add to a pipeline ?
Do we have a standerd IDE to write expressions ?
or if you can suggest any extension for VS code.
- tstack7 years agoFormer Employee
I don’t think so.
The expression language is mostly a subset of JavaScript, so I would just use an editor with support for that. The main difference is that expression language is just expressions, not statements. Don’t try to use things like
iforfunction(), you need to stick to arrow functions (e.g.(x, y) => x + y). One addition to the e-lang that is not in JavaScript is thematchoperator. You might find that useful if you have to do a lot of conditionals.- ayush_vipul7 years agoNew Contributor III
Thanks @tstack
This helped me a lot.
😀