Immutability In TypeScript
[!INFO]-
topic: ๐ฆ TypeScript
links: Interfaces in TypeScript
source: TypeScript course by the native web
tags: #permanent-note #published
Last Modified:
=dateformat(this.file.mtime, "MMM. dd, yyyy - HH:mm")
To make a property in TypeScript immutable, you can make it readonly
.
interface Person {
readonly firstName: string; // this value cannot be changed after initialization
lastName: string;
}