Menu
×
×
Correct!

Exercise:

Declare an object kindPerson from the Person interface, where all the properties are required.

interface Person { age: number; firstName: string; lastName?: string; } let kindPerson: Required<Person> = { age: 1800, firstName: "Santa", lastName: "Claus" };

Not Correct

Click here to try again.

Correct!

Next ❯
interface Person {
    age: number;
    firstName: string;
    lastName?: string;
}
            
let :  = {
    age: 1800,
    firstName: "Santa",
    lastName: "Claus"
};

    
  




Log in to keep your progress
Sign up to keep your progress

Completed 0 of 30 Exercises:

TypeScript Introduction
TypeScript Get Started
TypeScript Simple Types
TypeScript Special Types
TypeScript Arrays
TypeScript Tuples
TypeScript Object Types
TypeScript Enums
TypeScript Aliases & Interfaces
TypeScript Union Types
TypeScript Functions
TypeScript Casting
TypeScript Classes
TypeScript Basic Generics
TypeScript Utility Types

×

Reset the Score?

This will reset the score of ALL 30 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 30 TypeScript exercises.

Share your score: