How to Use Default Parameters in TypeScript
Too Long; Didn't Read
Default parameters are already widely supported in Javascript. They are used to give arguments values that should be used, if that argument is undefined. In the example above, since `y` is undefined when we call `myFunction, the default value is used. This avoids the issue where `y' may be `undefined` if the user doesn't mention it in the function. The only additional thing to consider is that we don't have to always define a type on a parameter that has a default value.