Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to make a parameter optional in typescript

// Optional parameter
function foo(x?: number) {
    console.log("x : "+ x);
}
foo();
foo(6);
 
PREVIOUS NEXT
Tagged: #parameter #optional #typescript
ADD COMMENT
Topic
Name
8+6 =