Hi Yoan,
I use it to precompute some values in a text-layer, and then use the output of that textlayer as data in another expression.
If the result of a textlayer is just string we need to use, or a number, then you can simply get the value or value.parseFloat() of the textlayer, but in some cases you want to precompute a list of values or a list of key/value pairs.
a JSON type object is ideal for this.
So the expression on my precompute text layer ends with JSON.stringify(myStuff);
-> this turns the object or list of data I have into “readable/parseable” sourcecode including brackets, quotes,…
And where I want to use that information, I do JSON.parse(textlayer.text.sourceText.value) to “read” the generated sourcecode of the data object, and so the data becomes part of the expression.
Before the new Javascript engine, the alternative was to use eval(), which can do even more (it can actually execute functions and statements, not just import a data object)