Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

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);
Comment

PREVIOUS NEXT
Code Example
Typescript :: angular start date end date validation 
Typescript :: how to get class weights while using keras imagedatagenerator 
Typescript :: typeorm select join column querybuilder 
Typescript :: ract import image 
Typescript :: typescript react function coponent props 
Typescript :: set constraints for UIView swift 
Typescript :: useCallback hook to fix useEffect re-render warning on function dependency 
Typescript :: typescript function 
Typescript :: stackoverflow ngbdate angular 
Typescript :: how to add custom snippets in emmet in visual studio code 
Typescript :: key with variable name in typescript 
Typescript :: typescript number to hex string 
Typescript :: elements without corner css 
Typescript :: typescript interface 
Typescript :: custom portal react 
Typescript :: how to divide 1 dataframe into two based on elements of 1 column 
Typescript :: typescript delete value from map 
Typescript :: typescript react switch case component 
Typescript :: import luno pricing to google sheets api 
Typescript :: depth-first search that chooses values for one variable at a time and returns when a variable has no legal values left to assign 
Typescript :: algorithm that prints if one of the numbers is multiple of the other 
Typescript :: stipe elements angular.js 
Typescript :: modifying 2d lists python 
Typescript :: How to join all url segments to make a url in javascipt 30seconds of code 
Typescript :: What types of Collections/Data structures you have used 
Typescript :: how to add every two elements in python 
Typescript :: nativescript routerextensions navigate 
Typescript :: edit lights in a room alexa 
Typescript :: delete the last string from file in typescript 
Typescript :: angular8 PrimeNg tabview 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =