ప్రధాన కంటెంట్‌కు వెళ్లండి
eLearner.app
TS TYPE GYMNASTICS ARENA

TS టైప్ అరేనా: టైప్ జిమ్నాస్టిక్స్

మూడు అధునాతన టైపింగ్ పజిల్‌లను (మ్యాప్ చేసిన రకాలు, షరతులు మరియు కీ రీమ్యాపింగ్) పరిష్కరించడం ద్వారా టైప్‌స్క్రిప్ట్ కంపైలర్ యొక్క పరిమితులను అధిగమించండి.

TYPE CONSTRAINT

యుటిలిటీ రకం 'పిక్<T, K>' యొక్క అనుకూల సంస్కరణను సృష్టించండి. మీ రకం 'MyPick<T, K>' తప్పనిసరిగా ఆబ్జెక్ట్ టైప్ T మరియు కీల యూనియన్‌ని అంగీకరించాలి, మ్యాప్ చేయబడిన రకాలు మరియు కీ పరిమితులను (Tకి విస్తరిస్తుంది) ఉపయోగించి T నుండి అభ్యర్థించిన లక్షణాలను మాత్రమే సంగ్రహిస్తుంది.

Constraint Monitor
CONSTRAINT UNMET
interface User {
name: string;
age: number;
active: boolean;
}
MyPick<User, "name" | "active">
✗ Type does not satisfy constraints or uses any/never
✗ Type does not satisfy constraints or uses any/nevertsc v5.4.5

Stuck?

Learn the fundamental concepts in the TypeScript course to solve this challenge.

Static TypeScript Compiler

Write valid type definitions to satisfy type assertions.

ఎడిటర్ లోడ్ అవుతోంది…