let variableToSet = checkedValue || defaultValue;
function func(arg, optArg = "defualtValue") { console.log(arg, optArg); } func("A", "B"); //output "A", "B" func("Test"); //output "Test", "defaultValue" func(); //output undefined, "defualtValue"