Complete the code to declare a variable with a string type.
let name: [1] = "Alice";
The string type tells TypeScript that the variable name should hold text.
Complete the code to define a function that returns a number.
function getAge(): [1] { return 30; }
The function returns a number, so the return type should be number.
Fix the error in the code by completing the type for the parameter.
function greet(person: [1]) { console.log("Hello, " + person); }
The parameter person is used as text, so it should be a string.
Fill both blanks to create a type that can be either a string or a number.
let value: [1] = 42; value = [2];
The type string | number means value can be a string or a number. Assigning "hello" is valid.
Fill all three blanks to create a function type that takes a number and returns a boolean.
type Check = ([1]: [2]) => [3];
The function type Check takes a parameter named num of type number and returns a boolean.
