Fix recursive types example in typescript roadmap (#4022)

Co-authored-by: Itamar Zwi <itamarz@amplicy.io>
pull/3997/head^2
JasonMan34 1 year ago committed by GitHub
parent bfbee6da0f
commit 8c2e812667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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> = T & { next: LinkedList<T> };
type LinkedList<T> = {
value: T;
next: LinkedList<T> | null;
};
let list: LinkedList<number> = {
value: 1,

Loading…
Cancel
Save