Skip to content

Commit

Permalink
2023-08-23T09:34:13.591Z
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Aug 23, 2023
1 parent ba19cd3 commit 7ed6826
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
34 changes: 34 additions & 0 deletions src/040-deriving-types-from-values/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Title

Deriving types from values

## Exercises

LEARNING GOAL: Understand the type world and the runtime world.
CONFUSION: Can I create runtime values from types?
LEARNING GOAL: Understand the `typeof` keyword.
CONFUSION: Is this the same as the JavaScript keyword?

LEARNING GOAL: You can only create types from runtime values, not the other way around.

LEARNING GOAL: Use `ReturnType` to get the return type of a function.
NOTEWORTHY: This is really good for extracting the return value of a third-party function.

LEARNING GOAL: Use `Parameters` to get the parameters of a function.

LEARNING GOAL: Understand the `keyof` keyword
CONFUSION: Why do we have to do `keyof typeof` instead of just `keyof`?

LEARNING GOAL: Understand indexed access types
CONFUSION: Why can't I just use `.name` instead of `['name']`?

LEARNING GOAL: Understand that you can pass unions into indexed access types.

LEARNING GOAL: Understand that you can pass `keyof` into an indexed access type.

LEARNING GOAL: Create an enum from an `as const` object.

LEARNING GOAL: Create an enum from an `as const` array.
LEARNING GOAL: Understand the `T[number]` syntax.

CONFUSION: Should I use enums, or 'as const' objects?

0 comments on commit 7ed6826

Please sign in to comment.