My issue lies not with optional primitive parameters, but with optional functions. For example, say I have a function that requires one parameter and one optional parameter.
function performTask(input: string, callback?: () => void){
let temp = input;
callback(); // using callback!() also does not work
}
performTask('example') // this line triggers an error 'callback is not a function'