Add ? after a parameter name to make it optional (its type becomes T | undefined). Or assign a default value like limit: number = 10, which makes it optional to callers while guaranteeing a value inside the function.
ADVERTISEMENT
We use cookies to collect and analyse information on site performance and usage, and to enhance and customise content and advertisements. Learn more
Required for basic website functionality.
Help us understand how visitors interact with the site.
Used to show relevant ads and measure ad performance.