Create a function with 2 parameters (myVar1 and myVar2,in that order), that are both strings.
Specify that myVar2 should be optional:
function myFunc(@(6): @(6), @(7): @(6)) {
return(myVar1 + (myVar2 || ""));
}
function myFunc(myVar1: string, myVar2?: string) {
return(myVar1 + (myVar2 || ""));
}