Sorry for the late reply! There’s a feature called JS Variables, which can pass values from a template to its script. It’s documented here: Get and Set | Tangible Loops & Logic
You can pass a string/text value, like this:
<Set js=variable_name>Hello</Set>
Or other value type like number:
<Set js=variable_name type=number>123</Set>
And access it from the Script section:
console.log( variable_name )
The above will output the value in the developer’s console.
Thank you for the tip @thepauly, i might give it a try.
Anticipating the next step of my project (see above, loop through Taxonomy Terms and run a JS function for each), i guessed it would be more difficult to handle with L&L than PHP code directly, so i made this that works fine: