TypeScript · Junior · Question 69 of 75
Are Array<string> and string[] different types?
- ✓Correct answer: No - they are two syntaxes for the same type
- 2Yes -
Array<string>is read-only - 3Yes -
string[]allows numbers
Explanation
Teams usually pick one style for consistency. For read-only arrays the equivalents are ReadonlyArray<string> and readonly string[].