From 8c2e8126670de91cf6654a59e19ca7b08e985e68 Mon Sep 17 00:00:00 2001 From: JasonMan34 Date: Tue, 12 Sep 2023 18:39:19 +0300 Subject: [PATCH] Fix recursive types example in typescript roadmap (#4022) Co-authored-by: Itamar Zwi --- .../content/112-advanced-types/104-recursive-types.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/typescript/content/112-advanced-types/104-recursive-types.md b/src/data/roadmaps/typescript/content/112-advanced-types/104-recursive-types.md index e97aca9f0..8d7f3f1bd 100644 --- a/src/data/roadmaps/typescript/content/112-advanced-types/104-recursive-types.md +++ b/src/data/roadmaps/typescript/content/112-advanced-types/104-recursive-types.md @@ -5,7 +5,10 @@ Recursive types in TypeScript are a way to define a type that references itself. For example, the following is a recursive type that represents a linked list: ```typescript -type LinkedList = T & { next: LinkedList }; +type LinkedList = { + value: T; + next: LinkedList | null; +}; let list: LinkedList = { value: 1,