SnipZard
Search snippets
Home
Portfolio
Contact
Readonly
The readonly modifier ensures that a property of an object cannot be reassigned.
Snippet:
type
Point
=
{
readonly x
:
number
;
readonly y
:
number
}
;
Copy Code
Example:
const
point
:
Point
=
{
x
:
10
,
y
:
20
}
;
Copy Code