Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Possible alternative solution to problem 15-intersection #69

Open
@seblondono

Description

@seblondono

I came up with a slightly different solution to problem 15-intersection which follows from problem 14-extends.

interfaceUserWithPostsextendsUser{posts:Post[]}

This interface also passes the type check and it creates a slightly different code completion on WebStorm (at least)
Screenshot 2022-12-20 at 23 25 58
Screenshot 2022-12-20 at 23 26 26

Vs the video solution using&
Screenshot 2022-12-20 at 23 34 10
Screenshot 2022-12-20 at 23 34 25

There is no massive difference between the 2 but I thought I'd mention it. I imagine using the& operator withtype is like using theextends withinterfaces. They do the same as far as I can tell.

Thanks a ton for the great content! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp