F
F
Fedooot012022-01-04 15:45:58
typescript
Fedooot01, 2022-01-04 15:45:58

What does this assignment do in a TypeScript type declaration?

Hello, in the translation of the TS documentation I came across the following code:

function f1<T, U extends keyof T = keyof T>(): void {}


Tell me why this assignment is needed U extends keyof T = keyof T, why can't you just write U extends keyof T?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question