TypeScriptSyntax
Readonly Property
Code example
interface Point {
readonly x: number;
}Prevents a property from being reassigned.
In TypeScript, readonly property: prevents a property from being reassigned — interface Point { readonly x: number; }
interface Point {
readonly x: number;
}interface Point {
readonly x: number;
}Prevents a property from being reassigned.
Use interface Point { readonly x: number; }.
Use this pattern: interface Point { readonly x: number; }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.