Avatar ·

How to properly declare constants in a TypeScript class?

Hi everyone! I just started learning TypeScript and ran into a problem. In regular JavaScript, I simply used `const` for constants, but when I try to do the same inside a class, TypeScript complains. I need my `MathUtils` class to have constants, for example, Pi, gravitational acceleration, and the speed of light. I want these values to be shared across all instances of the class and not be modifiable. I tried several options, but none work as I expect: ```typescript class MathUtils { // Option 1: just const const PI = 3.14159; // Error: 'const' declarations are not allowed in classes // Option 2: readonly readonly G = 9.81; // Works, but requires creating an instance // Option 3: static readonly static read