Skip to content

Commit bb4235d

Browse files
committed
Update README.md
1 parent 8bc2503 commit bb4235d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ strArr.push(50); // Compiler Error
101101

102102
## Q. How to implement class constants in TypeScript?
103103

104-
In TypeScript, the `const` keyword cannot be used to declare class properties. Doing so causes the compiler to an error with "A class member cannot have the 'const' keyword." TypeScript 2.0 has the `readonly` modifier.
104+
In TypeScript, the **const** keyword cannot be used to declare class properties. Doing so causes the compiler to an error with **A class member cannot have the 'const' keyword.** TypeScript 2.0 has the **readonly** modifier.
105+
106+
**Example:**
105107

106108
```ts
107109
class MyClass {

0 commit comments

Comments
 (0)