Currently, when there are additional scope variables for javascript queries, there is no option to give them default values.
This means that you either have to always provide a value for it, even if the value is only needed on some use cases, or add a "var value = value ?? false" at the top of your script (where "value" is the same word as the scope argument) to faciliate an "if(value){} within the script proper.
In lieu of being able to just run a script with an undefined value, being able to give it a default value would be cleaner than the current method outlined above.
This came up in office hours this week too! I am requesting this feature internally. I'm not sure if/when we'd ship this, but I'll follow up here with any updates
I wouldn't mind this at all, as long as the default defaults to undefined to keep backwards compatibility.... unless I'm the only one weird enough to fake Overloaded functions , but I have some queries that do different things if they get null, undefined, an object or a string