Here is an example of a variable trying to pass a value of another variable.
//eventname = 'USER1'
//Split on I and take second value, 1. First split place will be 0.
var myvar = APPL._eventprefix.split('I')[1];
//toString method
APPL.VAR2 = myvar.toString();
The result can used be in builtin DE command(s) like this:
if (APPL.VAR2 == 'T')
{resetResourceProperty('SOMERESOURCE1','Availability','1'); }
else if
(APPL.VAR2 == 'SOMETHINGELSE')
{resetResourceProperty('SOMERESOURCE2','Availability','0'); }
Error executing application-level runtime JavaScript script to_string for application MY_APPLICATION. The error is: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "toString" of undefined (<wascope>#3)