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;
}