Intermediate
TypeScript
Q52 / 100
What is the effect of declaring a class constructor parameter as "private readonly name: string"?
Correct! Well done.
Incorrect.
The correct answer is B) It automatically declares and initializes a private readonly class property from the constructor parameter
B
Correct Answer
It automatically declares and initializes a private readonly class property from the constructor parameter
Explanation
Parameter properties combine declaration and assignment: the modifier automatically creates and initializes a class member of the same name.
Progress
52/100