29
Custom functions don't have a concept of required and optional fields, but you can emulate that behavior using logic like this:
function foo(arg1, opt_arg2) {
if (arg1 == null) {
throw 'arg1 required';
}
return 'foo';
}
It's convention to use the prefix "opt_" for optional parameters, but it's not required.