Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript make function argument optional


        
            
        
     function multiply(a: number, b: number, c?: number): number {

    if (typeof c !== 'undefined') {
        return a * b * c;
    }
    return a * b;
}
Source by www.typescripttutorial.net #
 
PREVIOUS NEXT
Tagged: #typescript #function #argument #optional
ADD COMMENT
Topic
Name
9+8 =