runEvent Conditional Event arguments

I need to runEvent and pass some arguments to the calling function. In some cituation i need to pass an arguments in some do not can i use conditions inside of eventArguments

for example,
runEvent(event=‘bbbb’,eventArguments={if(test==1){test = 1}}); something like this

Can’t you just build out your eventArguments structure dynamically, and then pass the structure as the argument?

var eventargs = {};
if( test ) {
eventargs.test = 1;

runEvent( event=“bbbb”, eventArguments=eventargs );