Complete the code to declare a variable age with type number.
let age: [1] = 25;
string type for a number variable.The variable age should be annotated with the number type to hold numeric values.
Complete the code to declare a constant isActive with type boolean.
const isActive: [1] = true;string or number instead of boolean.The variable isActive should be annotated with the boolean type to hold true or false values.
Fix the error in the code by adding the correct type annotation to names as an array of strings.
let names: [1] = ["Alice", "Bob", "Charlie"];
string instead of string[].The variable names is an array of strings, so it should be annotated as string[].
Fill both blanks to declare a variable user as an object with name as string and age as number.
let user: [1] = { name: "John", age: 30 }; // user has name: string and age: number // Type annotation for user is [2]
name and age.age.The variable user is an object with name as string and age as number, so the type annotation is { name: string; age: number }.
Fill all three blanks to declare a variable coordinates as a tuple with two numbers: x and y.
let coordinates: [1] = [[2], [3]];
The variable coordinates is a tuple of two numbers, so the type is [number, number] and the values are numbers like 10 and 20.