Complete the code to declare a static property named count of type number.
class Counter { static [1]: number = 0; }
The static property is named count and typed as number.
Complete the code to declare a static method named getCount that returns a number.
class Counter { static count: number = 0; static [1](): number { return Counter.count; } }
The static method to return the count is named getCount.
Fix the error in the static method declaration to correctly access the static property count.
class Counter { static count: number = 0; static getCount(): number { return [1].count; } }
this to access static propertiesStatic methods should access static properties via the class name, here Counter.
Fill both blanks to declare a static readonly property named MAX_LIMIT of type number with value 100.
class Limit { [1] readonly [2]: number = 100; }
The property must be declared as static readonly MAX_LIMIT to be a static constant.
Fill all three blanks to declare a static method named increment that increases the static count by 1 and returns the new count.
class Counter { static count: number = 0; static [1](): number { Counter.count [2]= 1; return [3]; } }
-=The method increment adds 1 to Counter.count using += and returns the updated count.