DEV Community

Discussion on: Typescript Partial<T>, where have you been my whole life?

Collapse
 
danielg212 profile image
Danielg212

why not simply use optional parameters ?

interface Todo {
    title?: string;
    description?: string;
 }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
scitronboy profile image
Benjamin Ashbaugh

Just because something should be optional in a parameter for example doesn't mean it should be optional everywhere, as would happen if you set it optional in the interface