How Records Can Help You Implement Complex Data in Typescript
Too Long; Didn't Read
A Record is a utility type especially defined by TypeScript to help with a certain problem. Record types enforce key values, and allow you to create custom interfaces for the values. They are a great way to ensure consistency when trying to implement more complex types of data. A Record takes the form `Record<K, T` where`K` is the type of the key, and `T` is the type the values the key is allowed to be. In this case, we can define a type for User and a union type for our key.