Error TS1005 on Exercise 15 from Beginner's guide
fffjacquier opened this issue ยท 1 comments
fffjacquier commented
๐ 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?
fffjacquier commented
Found it, should use
type UserAndPosts = User & { posts: Post[] }