121
rated 0 times
[
122]
[
1]
/ answers: 1 / hits: 47870
/ 6 Years ago, sun, february 25, 2018, 12:00:00
As explained here, the ?
operator can be used to mark a function parameter as optional. What does the ?
operator mean on interface parameters? For example, if we have this TypeScript interface:
export interface Person {
phone?: number;
name?: string;
}
And a class that implements the interface:
class Customer implements Person {
}
Did Customer
now implement Person correctly because all the properties on the Person
interface are optional?
More From » angular