Mark As Completed Discussion

Try this exercise. Click the correct answer from the options.

What language does the following piece of code belong to?

TEXT/TYPESCRIPT
1class Person {
2  name: string;
3  lastName: string;
4  birthDate = new Date();
5
6  constructor(name: string, lastName: string) {
7    this.name = name;
8    this.lastName = lastName;
9  }
10}

Click the option that best answers the question.

  • Typescript
  • Javascript