Complete the code to declare an interface named Person.
interface [1] {
name: string;
}The interface name must be Person to match the declaration.
Complete the code to add an age property to the Person interface using declaration merging.
interface Person {
[1]: number;
}age.The property to add is age with type number.
Fix the error in the code by completing the interface declaration to merge properties.
interface Person {
name: string;
}
interface [1] {
age: number;
}To merge declarations, both interfaces must have the same name Person.
Fill both blanks to create a merged interface with a method.
interface [1] { name: string; } interface [2] { greet(): void; }
Both interfaces must be named Person to merge their properties and methods.
Fill all three blanks to create a merged interface with properties and a method.
interface [1] { name: string; } interface [2] { age: number; [3](): void; }
The interface name must be Person for both declarations to merge, and the method name is greet.
