Looking at this TypeScript code snippet:
const arr: ReadonlyArray<string> = [
"123",
"234"
];
arr.push("345");
An error is thrown by the TS compiler:
.Property 'push' does not exist on type 'ReadonlyArray<string>'
It's evident that the array cannot be modified. So, the question arises: what is the parent class of ReadonlyArray
? Is it derived from the standard Array
class?