Is there a way to set a default for a function passed as an argument to another function. By default i mean a function that does absolutely nothing.
So i can check if the function argument value is null and assign it to an empty void function:
MyFunction(someVar:string,callback:()=>void){
if(callback==null) {this.MyEmptyFunction();}else{callback();}
}
MyEmptyFunction():void{}
Is a way to avoid creating an empty function and the null check?