Complete the code to define a type alias for a user object.
type User = [1];The correct syntax for a type alias defining an object type uses curly braces with property names and types.
Complete the function parameter type using an inline type instead of a type alias.
function greet(user: [1]) { console.log(`Hello, ${user.name}`); }Inline types are written directly in the parameter list using curly braces to describe the object shape.
Fix the error in the type alias declaration for a product with id and name.
type Product = [1];The type alias for an object must use curly braces with property names and types, not function or tuple syntax.
Fill both blanks to create a type alias and use it in a function parameter.
type [1] = { title: string; pages: number }; function printBook(book: [2]) { console.log(book.title); }
The type alias name must be the same in both declaration and usage to match the type.
Fill all three blanks to define a type alias, use it inline, and declare a variable with that type.
type [1] = { x: number; y: number }; const point: [2] = { x: 10, y: 20 }; function logPoint(p: [3]) { console.log(`x: ${p.x}, y: ${p.y}`); }
Using the same type alias name consistently for declaration, variable type, and function parameter ensures type safety and clarity.