const vs readonly code example
Example: readonly vs const
in TS:
Both cannot be reassigned and effectively achieve the same thing.
However, because readonly is a typescript only thing, it only applies at compile time.
- use const for variables
- use readonly for properties