Question · Angular course · Module 1: Introduction to Angular
Array type in TypeScript
How do you correctly declare an array of strings in TypeScript?
Answer options
- const list: string = [];
- const list: string[] = [];
- const list: [string] = ();
- const list = string<[]>;
Show the answer
Correct answer:
- const list: string[] = [];