Answers for "How to pass optional parameters while omitting some other optional parameters?"

0

How to pass optional parameters while omitting some other optional parameters?

export interface INotificationService {
    error(message: string, title?: string, autoHideAfter? : number);
}

class X {
    error(message: string, title?: string, autoHideAfter?: number) {
        console.log(message, title, autoHideAfter);
    }
}

new X().error("hi there", undefined, 1000);
Posted by: Guest on February-26-2020

Code answers related to "How to pass optional parameters while omitting some other optional parameters?"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language