I like to use typescript interfaces for function properties, But I like to use default properties as well. How can I use both?
export interface test_interface{
owner: string,
length?: number,
max_players?: number,
}
const test_function = (test_props: test_interface) => {
const x = test_props.length; //could be undefined and I want a default value
}
question from:https://stackoverflow.com/questions/66068354/default-values-for-interface-for-function-properties-in-typescript