Complete the code to declare a public property named name of type string.
class Person { public [1]: string; }
The property name is declared as a public string property inside the class.
Complete the code to declare a private property named age of type number.
class Person { private [1]: number; }
public instead of private.string instead of number.The property age is declared as a private number property inside the class.
Fix the error in the property declaration to make isActive a boolean property.
class User { isActive: [1]; }
string or number instead of boolean.The property isActive should be declared with type boolean to hold true/false values.
Fill both blanks to declare a readonly property id of type number.
class Product { [1] [2]: number; }
private or public instead of readonly.The property id is declared as readonly so it cannot be changed after initialization, and its type is number.
Fill all three blanks to declare a protected property email of type string with an initial value.
class Account { protected [1]: [2] = [3]; }
number type instead of string.The property email is declared as protected so it is accessible in subclasses, has type string, and is initialized with the value 'user@example.com'.