Complete the code to declare an array of numbers using the shorthand syntax.
let numbers: number[1] = [1, 2, 3];
The correct syntax to declare an array of numbers is number[].
Complete the code to declare an array of strings using the generic Array syntax.
let fruits: Array[1] = ['apple', 'banana', 'cherry'];
The generic syntax for an array of strings is Array<string>.
Fix the error in the array type annotation syntax.
let scores: number[1] = [10, 20, 30];
The correct array type annotation uses square brackets [] after the type.
Fill both blanks to declare an array of booleans using generic syntax.
let flags: Array[1] = [2];
The generic array syntax is Array<boolean> and the array value is [true, false, true].
Fill all three blanks to declare an array of objects with a specific type.
type Person = { name: string, age: number };
let people: [1] = [2];
people.push([3]);The array type can be declared as Array<Person>. The initial array is [{ name: 'Alice', age: 30 }]. To add a new person, use an object like { name: 'Bob', age: 25 }.