Skip to main content
Frontend
Interviews
.dev
Problems
726. TypeScript Generic extends Constraint
Medium
•
...
Select the best answer.
function
getId
<
T
extends
{
id
:
string
}
>
(
value
:
T
)
{
return
value
.
id
;
}
What does extends enforce?
Exact object only
Primitive only
At least id:string present
Readonly object
Submit Answer
Reveal Answer
Select an option and submit your answer.
Next Problem
Auto-advance on correct answer