TypeScript · Types and shapes
Array types
Declares an array of a single element type. Readonly<string[]> prevents mutation.
Syntax
string[] / Array<string>Example
Example
const tags: string[] = ["html", "css"]; const scores: ReadonlyArray<number> = [90, 85];
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.