0
0
Typescriptprogramming~10 mins

Capitalize and Uncapitalize types in Typescript - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to capitalize the first letter of the string type.

Typescript
type Capitalized = [1]<'hello'>;
Drag options to blanks, or click blank then click option'
AUncapitalize
BUppercase
CCapitalize
DLowercase
Attempts:
3 left
💡 Hint
Common Mistakes
Using Uncapitalize instead of Capitalize.
Using Uppercase which changes all letters, not just the first.
2fill in blank
medium

Complete the code to uncapitalize the first letter of the string type.

Typescript
type LowercaseFirst = [1]<'Hello'>;
Drag options to blanks, or click blank then click option'
ACapitalize
BLowercase
CUppercase
DUncapitalize
Attempts:
3 left
💡 Hint
Common Mistakes
Using Capitalize instead of Uncapitalize.
Using Lowercase which changes all letters, not just the first.
3fill in blank
hard

Fix the error in the code to capitalize the first letter of the string type.

Typescript
type FixCap = [1]<'world'>;
Drag options to blanks, or click blank then click option'
ACapitalize
Bcapitalize
CUppercase
Duncapitalize
Attempts:
3 left
💡 Hint
Common Mistakes
Writing 'capitalize' with a lowercase c causes an error.
Using 'uncapitalize' which is not a valid utility type.
4fill in blank
hard

Fill both blanks to create a type that capitalizes and then uncapitalizes a string.

Typescript
type Transform = [1]<[2]<'example'>>;
Drag options to blanks, or click blank then click option'
ACapitalize
BUncapitalize
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of Capitalize and Uncapitalize.
Using the same utility type twice.
5fill in blank
hard

Fill all three blanks to create a type that uncapitalizes, capitalizes, and then uncapitalizes a string.

Typescript
type ComplexTransform = [1]<[2]<[3]<'Test'>>>;
Drag options to blanks, or click blank then click option'
AUncapitalize
BCapitalize
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of utility types.
Using lowercase names for utility types.