Skip to content

Commit

Permalink
2023-09-08T15:27:44.817Z
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Sep 8, 2023
1 parent 751e153 commit d118081
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// We can create types from values...

const user = {
id: 1,
name: "Waqas",
};

type UserFromValue = typeof user;

// ...so why not values from types?

interface User {
id: number;
name: string;
}

// Can we do this?
// const user = valueof User;
Empty file.
Empty file.

0 comments on commit d118081

Please sign in to comment.