Skip to content

Error TS1005 on Exercise 15 from Beginner's guide #64

@fffjacquier

Description

@fffjacquier

👋 Hello,

On this page https://www.totaltypescript.com/tutorials/beginners-typescript/combining-types-to-create-new-types/solution
if I use as suggested at the end

type UserAndPosts = (): User & { posts: Post[] }

export const getDefaultUserAndPosts = (): UserAndPosts => {

instead of
export const getDefaultUserAndPosts = (): User & { posts: Post[] } => {

I got errors: src/15-intersection.problem.ts:16:23 - error TS1005: '=>' expected.

What is wrong with it?

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