Basics
Challenges
Classes
Debugging
Events
External Files
Flow Control
Forms
Functions
Html Elements
Installation
Interfaces
Keywords
Modules
Namespaces
Operators
Reference Files
String
Types
TypeScript comes with a ReadonlyArray<T> type that is the same as Array<T> with all mutating methods removed, so you can make sure you don’t change your arrays after creation.
let colors : string[] = ["red","white","blue"];
let validColors : ReadonlyArray = colors;
// ok
colors.push("purple");
// not ok
// validColors.push("purple");