Put in order · JavaScript and TypeScript course · Module 7: Advanced TypeScript
Creating a Custom Utility Type
Order the steps for creating a custom utility type in TypeScript:
Items to put in order
- Define the generic parameter: type MyType<T>
- Define value transformation: T[K] or new type
- Use keyof to iterate over keys: [K in keyof T]
- Add modifiers: readonly or ?
You can check the correct answer by solving this task in the CodeWorlds game.