My function parameter should accept a 0 or false value for an optional parameter, so I am using the ?? operator instead of the || operator for default value assignment to avoid a valid value overwritten with the default value.
So, here is the sample function code:
function myfunction(param1: number, param2?: number): number
{
param2 = param2 ?? 1
console.log(param2)
return param2
}
However, even though the function works without problems, the ScriptLab editor reports a syntax error.
Is this a known ScriptLab bug?
Thanks.

Sounds like a bug, but the
ScriptLabadd-in is available with a source code (open source project). You can find the add-in's source code available publicly on GitHub - https://github.com/OfficeDev/script-lab. So, you may try debugging it to find the cause. Even if it is maintained by the Office team, nobody can stop you from adding or fixing things.