Answers for "const vs readonly ts"

1

const vs readonly ts

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
Posted by: Guest on May-10-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language