Complete the code to declare a string variable with the value 'hello'.
let greeting: string = [1];In TypeScript, string values must be enclosed in quotes. Single quotes 'hello' or double quotes "hello" correctly define a string literal.
Complete the code to get the length of the string stored in variable 'name'.
let length: number = name[1];In TypeScript, strings have a length property (without parentheses) to get their length.
Fix the error in the code to convert the string 'text' to uppercase.
let upper = text[1];The correct method to convert a string to uppercase in TypeScript is toUpperCase() with a capital C.
Fill both blanks to create a string that repeats 'ha' 3 times.
let laugh = [1].repeat([2]);
The repeat method repeats a string a given number of times. Use the string "ha" and repeat it 3 times.
Fill all three blanks to create a new string with the first letter capitalized and the rest lowercase.
let newStr = str[1](0, 1).[2]() + str[3](1).toLowerCase();
Use substring(0, 1) to get the first letter, then toUpperCase() to capitalize it. Use substring(1) to get the rest of the string.