Complete the code to declare a constructor parameter type for name.
class Person { name: string; constructor(name: [1]) { this.name = name; } }
The constructor parameter name should be of type string to match the property type.
Complete the code to declare a constructor parameter type for age.
class User { age: [1]; constructor(age: number) { this.age = age; } }
The age property and constructor parameter should both be number type.
Fix the error in the constructor parameter type for isActive.
class Account { isActive: boolean; constructor(isActive: [1]) { this.isActive = isActive; } }
The isActive property is a boolean, so the constructor parameter must also be boolean.
Fill both blanks to declare constructor parameter types for title and pages.
class Book { title: [1]; pages: [2]; constructor(title: string, pages: number) { this.title = title; this.pages = pages; } }
The title is text, so it uses string. The pages is a number, so it uses number.
Fill all three blanks to declare constructor parameter types for username, email, and verified.
class Member { username: [1]; email: [2]; verified: [3]; constructor(username: string, email: string, verified: boolean) { this.username = username; this.email = email; this.verified = verified; } }
username and email are text, so they use string. verified is a true/false flag, so it uses boolean.