How to make a class field readonly or immutable in TypeScript?
Originally Published Here ๐!
To make a class field readonly or immutable, you can use the readonly modifier keyword before the class field name in TypeScript.
TL;DR
// a simple class with 2 fields
// and make the `name` field readonly or immutable
/...
melvingeorge-me.hashnode.dev3 min read