Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Let's develop our sample further. Here we use an interface that describes object
In TypeScript, two types are compatible if their internal structure is compatible.
This allows us to implement an interface just by having the shape the interface requires, without an explicit `implements` clause.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

```ts twoslash
interface Person {
firstName: string;
Expand All @@ -125,7 +126,8 @@ TypeScript supports new features in JavaScript, like support for class-based obj
Here we're going to create a `Student` class with a constructor and a few public fields.
Notice that classes and interfaces play well together, letting the programmer decide on the right level of abstraction.

Also of note, the use of `public` on parameters to the constructor is a shorthand that allows us to automatically create properties with that name.
Also of note, the use of `public` on constructor parameters is a shorthand that automatically creates properties with those names.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


```ts twoslash
class Student {
Expand Down