![]() |
TypeScript Uppercase<StringType> template literal type transforms the characters of StringType to uppercase, ensuring that any string value assigned to it is represented in all uppercase letters. Syntax:type Geek= Uppercase<GFG>
Parameters:
Example 1: This example showcases how to convert a lowercase string to uppercase using the Javascript
Output: GEEKSFORGEEKS
Example 2: In this example, we define a type symbol with possible values “alpha,” “beta,” or “gamma.” It then creates a type geek by converting these values to uppercase. The result variable is assigned “ALPHA” and logs it to the console. Javascript
Output: ALPHA
Reference: https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html#uppercasestringtype |
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |